]> git.scottworley.com Git - paperdoorknob/blobdiff - texfilter_test.py
texfilter to work around \emph nesting issue
[paperdoorknob] / texfilter_test.py
diff --git a/texfilter_test.py b/texfilter_test.py
new file mode 100644 (file)
index 0000000..8b603a3
--- /dev/null
@@ -0,0 +1,24 @@
+# paperdoorknob: Print glowfic
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, version 3.
+
+
+import unittest
+from texfilter import ApplyTexFilters
+
+
+class TestTexFilters(unittest.TestCase):
+
+    def testStripNBSP(self) -> None:
+        self.assertEqual(
+            ApplyTexFilters("FixBareEmph", b'\\emph{Yes?}'),
+            b'\\hspace{0pt}\\emph{Yes?}')
+        self.assertEqual(
+            ApplyTexFilters("FixBareEmph", b'Reassuring.\n\n\\emph{Yes?}'),
+            b'Reassuring.\n\n\\hspace{0pt}\\emph{Yes?}')
+
+
+if __name__ == '__main__':
+    unittest.main()