diff --git a/lib/rouge/lexers/elixir.rb b/lib/rouge/lexers/elixir.rb index 6bcea49839..edfe5badd5 100644 --- a/lib/rouge/lexers/elixir.rb +++ b/lib/rouge/lexers/elixir.rb @@ -51,15 +51,25 @@ class Elixir < RegexLexer state :strings do rule %r/(%[A-Ba-z])?"""(?:.|\n)*?"""/, Str::Doc rule %r/'''(?:.|\n)*?'''/, Str::Doc - rule %r/"/, Str::Doc, :dqs - rule %r/'.*?'/, Str::Single + rule %r/"/, Str::Double, :dqs + rule %r/'/, Str::Single, :sqs rule %r{(?, ~|abc|, ~r/abc/, etc diff --git a/spec/visual/samples/elixir b/spec/visual/samples/elixir index acc91c07e2..ac3bb253d1 100644 --- a/spec/visual/samples/elixir +++ b/spec/visual/samples/elixir @@ -20,6 +20,20 @@ # maps %{key: 1} +# strings +"Hello world" +"Hello \" world" +"Hello \n world" +"Hello #{"world"}" +"Hello #world" + +# charlists +'Hello world' +'Hello \' world' +'Hello \n world' +'Hello #{'world'}' +'Hello #world' + # regexes ~r()gif ~r[]gfi