Skip to content

Commit

Permalink
Merge pull request #8 from cubeguerrero/master
Browse files Browse the repository at this point in the history
Fix `sole_raw_text` to allow `$`
  • Loading branch information
rstacruz authored Oct 18, 2017
2 parents 0744255 + 5dc07d3 commit e806ee7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/expug/tokenizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ defmodule Expug.Tokenizer do
def sole_raw_text(state) do
state
|> whitespace()
|> eat(~r/^[^\n$]+/, :raw_text)
|> eat(~r/^[^\n]+$/, :raw_text)
end

@doc "Matches `title` in `title= hello`"
Expand Down
10 changes: 10 additions & 0 deletions test/tokenizer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ defmodule ExpugTokenizerTest do
]
end

test ~S[div $100] do
output = tokenize(~S[div $100])
assert reverse(output) == [
{{1, 1}, :indent, 0},
{{1, 1}, :element_name, "div"},
{{1, 5}, :raw_text, "$100"}
]
end


test "with indent" do
output = tokenize("head\n title")
assert reverse(output) == [
Expand Down

0 comments on commit e806ee7

Please sign in to comment.