From d45c2d44b6b993ae7d54634948d69c2951d6dda3 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 22 Apr 2017 17:03:45 +0900 Subject: [PATCH] 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. --- lib/haml/parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/haml/parser.rb b/lib/haml/parser.rb index 939ca2d2..dd2bbb7a 100644 --- a/lib/haml/parser.rb +++ b/lib/haml/parser.rb @@ -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