mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-20 05:06:30 +09:00
Keep a code block's leading newline when linking a message's text
A <pre> whose text starts with a newline needs one more written out to survive being parsed again, as the html5 serializer does with preserve_newline. Without it, linking text dropped one more of a code block's leading blank lines than rendering did before.
This commit is contained in:
1 parent
6052b123d5
commit
4e29c6e32b
2 files changed
+8
-1
No files matched your search
@@ -130,7 +130,8 @@ module MessagesHelper
|
||||
end
|
||||
end
|
||||
|
||||
fragment.to_html.html_safe
|
||||
# A <pre> starting with a newline needs an extra one written out to survive the next parse
|
||||
fragment.to_html(preserve_newline: true).html_safe
|
||||
end
|
||||
|
||||
def messages_actions
|
||||
|
||||
Reference in new issue
Block a user