Skip to content

Commit

Permalink
Map CDATA to text to avoid including CDATA in HTML output.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jun 29, 2024
1 parent f97c68d commit 9794934
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/utopia/content/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def instruction(string)
end

def cdata(string)
@delegate.write(string)
@delegate.text(string[9..-4])
end

def text(string)
Expand Down
2 changes: 1 addition & 1 deletion test/utopia/content/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def parse(string)
[:tag_begin, foo_tag],
[:text, "Bob & Barley"],
[:write, "<!-- Comment -->"],
[:write, "<![CDATA[Hello & World]]>"],
[:text, "Hello & World"],
[:tag_end, foo_tag],
]

Expand Down

0 comments on commit 9794934

Please sign in to comment.