Skip to content

Commit

Permalink
Add backslash for @ to support JRuby
Browse files Browse the repository at this point in the history
Not sure about the exact details of the cause.
But it passes the tests in both CRuby and JRuby.
  • Loading branch information
k0kubun committed Apr 22, 2017
1 parent 8f20707 commit d45c2d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/haml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def self.parse_class_and_id(list)
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]
Expand Down Expand Up @@ -594,7 +594,7 @@ def parse_static_hash(text)

# 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
Expand Down

0 comments on commit d45c2d4

Please sign in to comment.