summaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-25 13:13:24 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-25 13:13:24 +0200
commitd441e656db576f266c4866e65ff9e4705d376381 (patch)
treef790918d6eb5b920aaba07444559d7b0f1585583 /test/command
parentfe0ffd272ea14b3f1a40c891403ef03f09f6294f (diff)
HTML writer: insert data- in front of unsupported attributes.
Thus, a span with attribute 'foo' gets written to HTML5 with 'data-foo', so it is valid HTML5. HTML4 is not affected. This will allow us to use custom attributes in pandoc without producing invalid HTML.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/custom-attributes.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/command/custom-attributes.html b/test/command/custom-attributes.html
new file mode 100644
index 000000000..67dccc1b8
--- /dev/null
+++ b/test/command/custom-attributes.html
@@ -0,0 +1,16 @@
+Custom attributes should automatically have data- added
+in HTML5:
+```
+% pandoc -t html5
+[hello]{foo="bar"}
+^D
+<span data-foo="bar">hello</span>
+```
+
+but not in HTML4:
+```
+% pandoc -t html4
+[hello]{foo="bar"}
+^D
+<span foo="bar">hello</span>
+```