Skip to content

Commit

Permalink
Respect attribute values without quotes
Browse files Browse the repository at this point in the history
Resolves #64
  • Loading branch information
ixti committed Dec 1, 2016
1 parent ce2e9d8 commit 64dc9bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion syntax/slim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*\[\s*
syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*(\s*" end="\s*)\s*" contained contains=slimAttr nextgroup=slimRuby

syn match slimAttr /\s*\%(\w\|-\)\+\s*=/me=e-1 contained contains=htmlArg nextgroup=slimAttrAssignment
syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString
syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString,slimAttrVariable

syn region slimWrappedAttrValue start="[^"']" end="\s\|$" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="{" end="}" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
Expand All @@ -58,6 +58,7 @@ syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="

syn region slimAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn region slimAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn match slimAttrVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained

syn region slimInnerAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr
syn region slimInnerAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr
Expand Down

0 comments on commit 64dc9bc

Please sign in to comment.