diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-06-17 15:38:10 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-06-17 15:38:10 -0500 |
commit | 3a03d9b65f96099e7c7a831469532c2cec7294c6 (patch) | |
tree | 46d84731c3a53157117fc4c8141fdf6b3d7b8b25 /test/pleroma/earmark_renderer_test.exs | |
parent | a704d5499c03cb5609ea38a5f2ef06095ced3ef3 (diff) | |
parent | a8adc300d4cfc88ef19f1977e32068437ed4ad00 (diff) | |
download | pleroma-nsfw-api-mrf.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into nsfw-api-mrfnsfw-api-mrf
Diffstat (limited to 'test/pleroma/earmark_renderer_test.exs')
-rw-r--r-- | test/pleroma/earmark_renderer_test.exs | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/test/pleroma/earmark_renderer_test.exs b/test/pleroma/earmark_renderer_test.exs deleted file mode 100644 index 776bc496a..000000000 --- a/test/pleroma/earmark_renderer_test.exs +++ /dev/null @@ -1,79 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.EarmarkRendererTest do - use Pleroma.DataCase, async: true - - test "Paragraph" do - code = ~s[Hello\n\nWorld!] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<p>Hello</p><p>World!</p>" - end - - test "raw HTML" do - code = ~s[<a href="http://example.org/">OwO</a><!-- what's this?-->] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<p>#{code}</p>" - end - - test "rulers" do - code = ~s[before\n\n-----\n\nafter] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<p>before</p><hr /><p>after</p>" - end - - test "headings" do - code = ~s[# h1\n## h2\n### h3\n] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<h1>h1</h1><h2>h2</h2><h3>h3</h3>] - end - - test "blockquote" do - code = ~s[> whoms't are you quoting?] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<blockquote><p>whoms’t are you quoting?</p></blockquote>" - end - - test "code" do - code = ~s[`mix`] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<p><code class="inline">mix</code></p>] - - code = ~s[``mix``] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<p><code class="inline">mix</code></p>] - - code = ~s[```\nputs "Hello World"\n```] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<pre><code class="">puts "Hello World"</code></pre>] - end - - test "lists" do - code = ~s[- one\n- two\n- three\n- four] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<ul><li>one</li><li>two</li><li>three</li><li>four</li></ul>" - - code = ~s[1. one\n2. two\n3. three\n4. four\n] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<ol><li>one</li><li>two</li><li>three</li><li>four</li></ol>" - end - - test "delegated renderers" do - code = ~s[a<br/>b] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == "<p>#{code}</p>" - - code = ~s[*aaaa~*] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<p><em>aaaa~</em></p>] - - code = ~s[**aaaa~**] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<p><strong>aaaa~</strong></p>] - - # strikethrought - code = ~s[<del>aaaa~</del>] - result = Earmark.as_html!(code, %Earmark.Options{renderer: Pleroma.EarmarkRenderer}) - assert result == ~s[<p><del>aaaa~</del></p>] - end -end |