1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Use safer delimiter for interpolation

This commit is contained in:
Takashi Kokubun 2019-09-12 22:59:04 +09:00
parent e887ab532d
commit f706c0bfb2
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -56,7 +56,7 @@ module Hamlit
# We should handle interpolation here to escape only interpolated values.
def compile_interpolated_plain(node)
unless Ripper.respond_to?(:lex) # No Ripper.lex in truffleruby
return [:multi, [:escape, node.value[:escape_interpolation], [:dynamic, "%Q[#{node.value[:value]}]"]], [:newline]]
return [:multi, [:escape, node.value[:escape_interpolation], [:dynamic, "%Q\0#{node.value[:value]}\0"]], [:newline]]
end
temple = [:multi]