mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:00:49 +08:00
FIX: Nested quotes in BBCode
Previously attributes such as `[test a='a"a' b="a'a"]` were not correctly handled. This amends the regex parser to ensure it correctly parses attributes without breaking incorrectly on the first nested quote
This commit is contained in:
@ -1744,10 +1744,10 @@ HTML
|
||||
end
|
||||
|
||||
it "adds attributes as data-attributes" do
|
||||
cooked = PrettyText.cook("[wrap=toc name=\"pepper bell\" id=1]taco[/wrap]")
|
||||
cooked = PrettyText.cook("[wrap=toc name=\"single quote's\" id='1\"2']taco[/wrap]")
|
||||
|
||||
html = <<~HTML
|
||||
<div class="d-wrap" data-wrap="toc" data-name="pepper bell" data-id="1">
|
||||
<div class="d-wrap" data-wrap="toc" data-name="single quote's" data-id="1&quot;2">
|
||||
<p>taco</p>
|
||||
</div>
|
||||
HTML
|
||||
|
Reference in New Issue
Block a user