Skip to content

Commit

Permalink
Support mustache template in Svelte
Browse files Browse the repository at this point in the history
This ensures we delegate the handling of `{{}}` in mustache template to
JS lexer.
  • Loading branch information
tancnle committed Dec 18, 2024
1 parent 251423d commit 18e8bf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/svelte.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(*)
rule %r/}/, Str::Interpol, :pop!

# Allow JS lexer to handle matched curly braces within template
rule(/(?<=^|[^\\])\{.*?(?<=^|[^\\])\}/) do
rule(/(?<=^|[^\\])\{+.*?(?<=^|[^\\])\}+/) do
delegate @js
end

Expand Down

0 comments on commit 18e8bf2

Please sign in to comment.