aboutsummaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-09-19 14:49:46 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-09-19 14:53:29 -0700
commit136bf901aa088eaf4e5c996c71e0a36c171f1587 (patch)
tree84a45f3c0c0ec0eefa8f7ae7b245a940c6f45b7f /test/command
parentdba5c8d4e39c0bedf2a46191ad393bf84620bee5 (diff)
downloadpandoc-136bf901aa088eaf4e5c996c71e0a36c171f1587.tar.gz
Markdown reader: distinguish autolinks in the AST.
With this change, autolinks are parsed as Links with the `uri` class. (The same is true for bare links, if the `autolink_bare_uris` extension is enabled.) Email autolinks are parsed as Links with the `email` class. This allows the distinction to be represented in the URI. Formerly the `uri` class was added to autolinks by the HTML writer, but it had to guess what was an autolink and could not distinguish `[http://example.com](http://example.com)` from `<http://example.com>`. It also incorrectly recognized `[pandoc](pandoc)` as an autolink. Now the HTML writer simply passes through the `uri` attribute if it is present, but does not add anything. The Textile writer has been modified so that the `uri` class is not explicitly added for autolinks, even if it is present. Closes #4913.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/3716.md2
-rw-r--r--test/command/4913.md34
2 files changed, 35 insertions, 1 deletions
diff --git a/test/command/3716.md b/test/command/3716.md
index 7e00819da..81e4a9568 100644
--- a/test/command/3716.md
+++ b/test/command/3716.md
@@ -2,5 +2,5 @@
% pandoc
<http://example.com>{.foo}
^D
-<p><a href="http://example.com" class="uri foo">http://example.com</a></p>
+<p><a href="http://example.com" class="foo">http://example.com</a></p>
```
diff --git a/test/command/4913.md b/test/command/4913.md
new file mode 100644
index 000000000..6492b80ce
--- /dev/null
+++ b/test/command/4913.md
@@ -0,0 +1,34 @@
+```
+% pandoc -f markdown -t html
+[https://pandoc.org](https://pandoc.org)
+^D
+<p><a href="https://pandoc.org">https://pandoc.org</a></p>
+```
+
+```
+% pandoc -f markdown -t markdown
+[https://pandoc.org](https://pandoc.org)
+^D
+<https://pandoc.org>
+```
+
+```
+% pandoc -f markdown -t html
+<https://pandoc.org>
+^D
+<p><a href="https://pandoc.org" class="uri">https://pandoc.org</a></p>
+```
+
+```
+% pandoc -f markdown -t html
+<https://pandoc.org>{.foo}
+^D
+<p><a href="https://pandoc.org" class="foo">https://pandoc.org</a></p>
+```
+
+```
+% pandoc -f markdown -t html
+<me@example.com>
+^D
+<p><a href="mailto:me@example.com" class="email">me@example.com</a></p>
+```