mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 18:41:07 +08:00
FIX: Empty inline BBCodes were broken (#18276)
Upgrading to Markdown.it v13 broke empty inline BBCodes. This works around the problem by adding an empty token before a closing token if the previous token was a BBCode token. It also removes the unused `jump` attribute which was removed in Markdown.it v12.3
This commit is contained in:
@ -1714,6 +1714,10 @@ HTML
|
||||
expect(PrettyText.cook("a[i]b[/i]c")).to eq('<p>a<span class="bbcode-i">b</span>c</p>')
|
||||
end
|
||||
|
||||
it "supports empty inline BBCode" do
|
||||
expect(PrettyText.cook("a[b][/b]c")).to eq('<p>a<span class="bbcode-b"></span>c</p>')
|
||||
end
|
||||
|
||||
it "can handle bbcode after a newline" do
|
||||
# this is not 100% ideal cause we get an extra p here, but this is pretty rare
|
||||
expect(PrettyText.cook("a\n[code]code[/code]")).to eq("<p>a</p>\n<pre><code class=\"lang-auto\">code</code></pre>")
|
||||
|
Reference in New Issue
Block a user