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

Add backslash for @ to support JRuby

Not sure about the exact details of the cause.
But it passes the tests in both CRuby and JRuby.
This commit is contained in:
Takashi Kokubun 2017-04-22 17:03:45 +09:00
parent 8f207073c2
commit d45c2d44b6

View file

@ -555,7 +555,7 @@ module Haml
attributes = {}
return attributes if list.empty?
list.scan(/([#.])([-:_a-zA-Z0-9@]+)/) do |type, property|
list.scan(/([#.])([-:_a-zA-Z0-9\@]+)/) do |type, property|
case type
when '.'
if attributes[CLASS_KEY]
@ -594,7 +594,7 @@ module Haml
# Parses a line into tag_name, attributes, attributes_hash, object_ref, action, value
def parse_tag(text)
match = text.scan(/%([-:\w]+)([-:\w.#@]*)(.+)?/)[0]
match = text.scan(/%([-:\w]+)([-:\w.#\@]*)(.+)?/)[0]
raise SyntaxError.new(Error.message(:invalid_tag, text)) unless match
tag_name, attributes, rest = match