Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed Jul 1, 2024
1 parent 6cc1b0b commit 8023568
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/solid/parser/base.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ defmodule Solid.Parser.Base do
all_tags = base_tags ++ (custom_tags || [])

tags =
choice(all_tags)
|> tag(:tag)
case all_tags do
[] -> []
[single_tag] -> single_tag |> tag(:tag)
_ -> choice(all_tags) |> tag(:tag)
end

text =
lookahead_not(
Expand Down
18 changes: 18 additions & 0 deletions test/support/custom_parsers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@ end
defmodule NoRenderParser do
use Solid.Parser.Base, excluded_tags: [Solid.Tag.Render]
end

defmodule Parser do
use Solid.Parser.Base,
excluded_tags: [
Solid.Tag.Break,
Solid.Tag.Continue,
Solid.Tag.Counter,
Solid.Tag.Comment,
Solid.Tag.Assign,
Solid.Tag.Capture,
Solid.Tag.If,
Solid.Tag.Case,
Solid.Tag.For,
Solid.Tag.Raw,
Solid.Tag.Cycle,
Solid.Tag.Render
]
end

0 comments on commit 8023568

Please sign in to comment.