def convert_quoted_text(match, type, scope)
unescaped_attrs = nil
if match[0].start_with? '\\'
if scope == :constrained && !(attrs = match[2]).nil_or_empty?
unescaped_attrs = %([#{attrs}])
else
return match[0][1..-1]
end
end
if scope == :constrained
if unescaped_attrs
%(#{unescaped_attrs}#{Inline.new(self, :quoted, match[3], :type => type).convert})
else
if (attributes = parse_quoted_text_attributes(match[2]))
id = attributes.delete 'id'
type = :unquoted if type == :mark
else
id = nil
end
%(#{match[1]}#{Inline.new(self, :quoted, match[3], :type => type, :id => id, :attributes => attributes).convert})
end
else
if (attributes = parse_quoted_text_attributes(match[1]))
id = attributes.delete 'id'
type = :unquoted if type == :mark
else
id = nil
end
Inline.new(self, :quoted, match[2], :type => type, :id => id, :attributes => attributes).convert
end
end