Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(talk): preserve whitespace in markdown code blocks #7106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/wrapped-markdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WrappedMarkdown extends React.Component {
<div onClick={this.onClick}>
<Markdown
relNofollow
content={this.props.content}
content={this.props.content.trim()}
project={this.props.project}
header={this.props.header}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/talk/comment-preview.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ module.exports = createReactClass
render: ->
<div className='talk-comment-preview'>
<h1>{@props.header}</h1>
<Markdown className='talk-comment-preview-content' content={@props.content} />
<Markdown className='talk-comment-preview-content' content={@props.content.trim()} />
</div>
2 changes: 1 addition & 1 deletion app/talk/inbox-conversation.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Message = createReactClass
<strong><Link to="/users/#{@state.commentOwner?.login}">{@state.commentOwner?.display_name}</Link> (@{@state.commentOwner?.login})</strong>{' '}
<span>{timestamp(@props.data.updated_at)}</span>
</span>
<Markdown>{@props.data.body}</Markdown>
<Markdown>{@props.data.body.trim()}</Markdown>
</div>

module.exports = createReactClass
Expand Down
3 changes: 3 additions & 0 deletions css/inbox.styl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
font-style: italic
p
margin: 5px 0
.markdown
> pre
white-space: pre-wrap

.new-message-form
@extend .talk-module
Expand Down
2 changes: 1 addition & 1 deletion css/talk.styl
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
opacity: 0.5

> pre
white-space: pre-line
white-space: pre-wrap

img
max-width: 100%
Expand Down
Loading
Loading