summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-27 12:09:08 -0700
committerAndrew Godwin2022-11-27 12:09:08 -0700
commit8e9e3ecf6935db84bbc731252f592795675de685 (patch)
treeeb3f690cdc7504b3f8fc2da716c1bbfc4bacc36c /tests
parent6c7ddedd342553b53dd98c8de9cbe9e8e2e8cd7c (diff)
downloadtakahe-8e9e3ecf6935db84bbc731252f592795675de685.tar.gz
takahe-8e9e3ecf6935db84bbc731252f592795675de685.tar.bz2
takahe-8e9e3ecf6935db84bbc731252f592795675de685.zip
Some cleanup around editing
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_html.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/core/test_html.py b/tests/core/test_html.py
new file mode 100644
index 0000000..012a0ce
--- /dev/null
+++ b/tests/core/test_html.py
@@ -0,0 +1,15 @@
+from core.html import html_to_plaintext
+
+
+def test_html_to_plaintext():
+
+ assert html_to_plaintext("<p>Hi!</p>") == "Hi!"
+ assert html_to_plaintext("<p>Hi!<br>There</p>") == "Hi!\nThere"
+ assert (
+ html_to_plaintext("<p>Hi!</p>\n\n<p>How are you?</p>") == "Hi!\n\nHow are you?"
+ )
+
+ assert (
+ html_to_plaintext("<p>Hi!</p>\n\n<p>How are<br> you?</p><p>today</p>")
+ == "Hi!\n\nHow are\n you?\n\ntoday"
+ )