Skip to content

Commit

Permalink
Merge pull request github#1269 from jinhucheung/perf-test-commonmarke…
Browse files Browse the repository at this point in the history
…r-options

Improve commonmarker test case
  • Loading branch information
kivikakk authored May 7, 2019
2 parents c48e9ca + 7b17174 commit c9358d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/markup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ def test_commonmarker_options
assert_equal "<p>hello <!-- raw HTML omitted --> world</p>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "hello <bad> world")
assert_equal "<p>hello <bad> world</p>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})

assert_equal "&lt;style>.red{color: #ff2727;}&lt;/style>\n", GitHub::Markup.render("test.md", "<style>.red{color: #ff2727;}</style>", options: {commonmarker_opts: [:UNSAFE]})
assert_equal "<style>.red{color: #ff2727;}</style>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "<style>.red{color: #ff2727;}</style>", options: {commonmarker_opts: [:UNSAFE], commonmarker_exts: [:autolink, :table, :strikethrough]})
assert_equal "&lt;style>.red{color: red;}&lt;/style>\n", GitHub::Markup.render("test.md", "<style>.red{color: red;}</style>", options: {commonmarker_opts: [:UNSAFE]})
assert_equal "<style>.red{color: red;}</style>\n", GitHub::Markup.render("test.md", "<style>.red{color: red;}</style>", options: {commonmarker_opts: [:UNSAFE], commonmarker_exts: [:autolink, :table, :strikethrough]})

assert_equal "&lt;style>.red{color: red;}&lt;/style>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "<style>.red{color: red;}</style>", options: {commonmarker_opts: [:UNSAFE]})
assert_equal "<style>.red{color: red;}</style>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "<style>.red{color: red;}</style>", options: {commonmarker_opts: [:UNSAFE], commonmarker_exts: [:autolink, :table, :strikethrough]})
end
end

0 comments on commit c9358d9

Please sign in to comment.