Skip to content

Commit

Permalink
i337-ast-metadata
Browse files Browse the repository at this point in the history
        New AST format speced and implemented

        REMAINING: Escaping and Encoding
  • Loading branch information
RobertDober committed Jun 28, 2020
1 parent 4a4d24d commit 5d5202f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 75 deletions.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 1.4.6 ????/??/??

- [366-simplify-transform](https://github.com/pragdave/earmark/issues/366)
Kudos to [Eksperimental](https://github.com/eksperimental)

- [353-oneline-html-tags](https://github.com/pragdave/earmark/issues/353)

- [351-html-tags-without-newlines](https://github.com/pragdave/earmark/issues/351)
Expand Down
5 changes: 4 additions & 1 deletion lib/earmark/transform.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ defmodule Earmark.Transform do


defp to_html(ast, options) do
_to_html(ast, options, Map.get(options, :initial_indent, 0)) |> IO.iodata_to_binary
_to_html(ast, options, Map.get(options, :initial_indent, 0))|> IO.iodata_to_binary
end

defp _to_html(ast, options, level, verbatim \\ false)
defp _to_html({:comment, _, content, _}, _options, _level, _verbatim) do
"<!--#{content}-->"
end
defp _to_html({tag, atts, _, _}, options, level, _verbatim) when tag in @void_elements do
[ make_indent(options, level), open_tag(tag, atts), "\n" ]
end
Expand Down
6 changes: 4 additions & 2 deletions test/acceptance/transform/meta_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule Acceptance.Transform.MetaTest do
import Support.AstHelpers, only: [ast_from_md: 1]
import Earmark.Transform

# Needs to pass with #359
@moduletag :wip
describe "pre and verbatim" do
@pre """
some code
Expand All @@ -15,10 +17,10 @@ defmodule Acceptance.Transform.MetaTest do
assert transform(ast) == expected
end
test "base case with verbatim" do
[{"pre", atts, children}] = ast_from_md(@pre)
[{"pre", atts, children, _}] = ast_from_md(@pre)
expected = "<pre><code> some code</code></pre>\n"

assert transform([{"pre", atts, children, %{meta: %{verbatim: true}}}]) == expected
assert transform([{"pre", atts, children, %{verbatim: true}}]) == expected
end
end
end
52 changes: 0 additions & 52 deletions test/functional/ast/renderer/ast_walker_test.exs

This file was deleted.

20 changes: 0 additions & 20 deletions test/functional/ast/renderer/walker_test.exs

This file was deleted.

0 comments on commit 5d5202f

Please sign in to comment.