From ca08ab1e5ebce1679f11e0d89b7e503f744c555e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 7 Jul 2016 17:11:16 +0200 Subject: [PATCH] XSL file to convert HTML to tomboy markup --- templates/html2tomboy.xsl | 93 +++++++++++++++++++++++++++++++++ tests/data/full-formattest.html | 41 +++++++++++++++ tests/html2tomboyXslTest.php | 24 +++++++++ 3 files changed, 158 insertions(+) create mode 100644 templates/html2tomboy.xsl create mode 100644 tests/data/full-formattest.html create mode 100644 tests/html2tomboyXslTest.php diff --git a/templates/html2tomboy.xsl b/templates/html2tomboy.xsl new file mode 100644 index 0000000..a354000 --- /dev/null +++ b/templates/html2tomboy.xsl @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <size:small> + + </size:small> + + + <size:large> + + </size:large> + + + <size:huge> + + </size:huge> + + + <link:url> + + + + + + + + + </link:url> + + + <link:internal> + + </link:internal> + + + + Unsupported tag + + + + + + + + diff --git a/tests/data/full-formattest.html b/tests/data/full-formattest.html new file mode 100644 index 0000000..74d27c0 --- /dev/null +++ b/tests/data/full-formattest.html @@ -0,0 +1,41 @@ + + + Test + + Eine Zeile Text.
+Zeilenumbruch.
+Noch ein Zeilenumbruch.
+
+Eine Leerzeile obendrüber.
+
+Jetzt kommt eine Liste:
+ +Formatierungen:
+Fetter Text
+Kursiver Text
+Durchgestrichener Text
+Hervorgehobener Text
+Feste Breite
+
+Schriftgrößen:
+klein
+normal
+groß
+riesig
+
+Links:
+ +
+Ende.
+ diff --git a/tests/html2tomboyXslTest.php b/tests/html2tomboyXslTest.php new file mode 100644 index 0000000..5e9139e --- /dev/null +++ b/tests/html2tomboyXslTest.php @@ -0,0 +1,24 @@ +assertEquals( + 0, $retval, + "diff exit status is not 0:\n" . implode("\n", $out) + ); + } +} +?> \ No newline at end of file -- 2.30.2