-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from pragdave/i228-block-level-html
Fixes: #228
- Loading branch information
Showing
6 changed files
with
70 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
defmodule Acceptance.Ast.Html.PermissiveTest do | ||
use ExUnit.Case, async: true | ||
import Support.Helpers, only: [as_ast: 1] | ||
|
||
@verbatim %{meta: %{verbatim: true}} | ||
|
||
describe "some nesting" do | ||
test "simple case" do | ||
markdown = "<div>\ncontent\n </div>" | ||
ast = [{"div", [], ["content"], @verbatim}] | ||
messages = [] | ||
|
||
assert as_ast(markdown) == {:ok, ast, messages} | ||
end | ||
|
||
test "more nesting" do | ||
markdown = "<div>\n<section>\n<span>content</span>\n</section>\n</div>" | ||
ast = [{"div", [], | ||
["<section>", "<span>content</span>", "</section>"], @verbatim}] | ||
messages = [] | ||
|
||
assert as_ast(markdown) == {:ok, ast, messages} | ||
end | ||
end | ||
|
||
describe "arbitrary tags" do | ||
# Needs a fix with issue [#326](https://github.com/pragdave/earmark/issues/326) | ||
test "mixture of tags (was regtest #103)" do | ||
markdown = "<x>a\n<y></y>\n<y>\n<z>\n</z>\n<z>\n</x>" | ||
ast = [{"x", '', ["a", "<y></y>", "<y>", "<z>", "</z>", "<z>"], @verbatim}] | ||
messages = Enum.zip([1, 3, 6], ~w[x y z]) | ||
|> Enum.map(fn {lnb, tag} -> {:warning, lnb, "Failed to find closing <#{tag}>"} end) | ||
|
||
assert as_ast(markdown) == {:error, ast, messages} | ||
end | ||
end | ||
end | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters