aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-07-18 22:30:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-18 22:31:03 -0700
commit28cad165179378369fcf4d25656ea28357026baa (patch)
treed94b27ef8175fbdfaee04828bf5b6f64528acd4a /test
parent5c655e86d5d34172bc5892927309d8dff6023493 (diff)
downloadpandoc-28cad165179378369fcf4d25656ea28357026baa.tar.gz
Markdown writer: prefer using raw_attribute when enabled.
The `raw_attribute` will be used to mark raw bits, even HTML and LaTeX, and even when `raw_html` and `raw_tex` are enabled, as they are by default. To get the old behavior, disable `raw_attribute` in the writer. Closes #4311.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/Markdown.hs2
-rw-r--r--test/command/4164.md2
-rw-r--r--test/command/macros.md10
-rw-r--r--test/command/parse-raw.md4
-rw-r--r--test/writer.markdown52
5 files changed, 56 insertions, 14 deletions
diff --git a/test/Tests/Writers/Markdown.hs b/test/Tests/Writers/Markdown.hs
index 533be268a..aae4d082c 100644
--- a/test/Tests/Writers/Markdown.hs
+++ b/test/Tests/Writers/Markdown.hs
@@ -40,7 +40,7 @@ infix 4 =:
tests :: [TestTree]
tests = [ "indented code after list"
=: (orderedList [ para "one" <> para "two" ] <> codeBlock "test")
- =?> "1. one\n\n two\n\n<!-- -->\n\n test"
+ =?> "1. one\n\n two\n\n```{=html}\n<!-- -->\n```\n test"
, "list with tight sublist"
=: bulletList [ plain "foo" <> bulletList [ plain "bar" ],
plain "baz" ]
diff --git a/test/command/4164.md b/test/command/4164.md
index 8cfc960a0..50c3117ec 100644
--- a/test/command/4164.md
+++ b/test/command/4164.md
@@ -12,7 +12,7 @@ Here is inline html:
<div>
-<balise> bla bla
+`<balise>`{=html} bla bla
</div>
diff --git a/test/command/macros.md b/test/command/macros.md
index 0c91944a1..e3c07e661 100644
--- a/test/command/macros.md
+++ b/test/command/macros.md
@@ -1,5 +1,5 @@
```
-% pandoc -f markdown+latex_macros -t markdown
+% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
\newcommand{\my}{\phi}
$\my+\my$
^D
@@ -9,7 +9,7 @@ $\phi+\phi$
```
```
-% pandoc -f markdown-latex_macros -t markdown
+% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute
\newcommand{\my}{\phi}
$\my+\my$
^D
@@ -70,7 +70,7 @@ x &= y\\\end{aligned}\]
```
```
-% pandoc -f markdown+latex_macros -t markdown
+% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
\newcommand{\my}{\phi}
\begin{equation}
\my+\my
@@ -84,7 +84,7 @@ x &= y\\\end{aligned}\]
```
```
-% pandoc -f markdown-latex_macros -t markdown
+% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute
\newcommand{\my}{\phi}
\begin{equation}
\my+\my
@@ -98,7 +98,7 @@ x &= y\\\end{aligned}\]
```
```
-% pandoc -f markdown+latex_macros -t markdown
+% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
\newcommand{\my}{\emph{a}}
\my
^D
diff --git a/test/command/parse-raw.md b/test/command/parse-raw.md
index f4e493c69..a1a41b551 100644
--- a/test/command/parse-raw.md
+++ b/test/command/parse-raw.md
@@ -2,7 +2,7 @@
% pandoc -f latex+raw_tex -t markdown
\emph{Hi \foo{there}}
^D
-*Hi \foo{there}*
+*Hi `\foo{there}`{=latex}*
```
```
@@ -16,7 +16,7 @@
% pandoc -f html+raw_html -t markdown
<em>Hi <blink>there</blink></em>
^D
-*Hi <blink>there</blink>*
+*Hi `<blink>`{=html}there`</blink>`{=html}*
```
```
diff --git a/test/writer.markdown b/test/writer.markdown
index 6aab1e597..7393ee18e 100644
--- a/test/writer.markdown
+++ b/test/writer.markdown
@@ -399,18 +399,35 @@ bar
Interpreted markdown in a table:
+```{=html}
<table>
+```
+```{=html}
<tr>
+```
+```{=html}
<td>
+```
This is *emphasized*
+```{=html}
</td>
+```
+```{=html}
<td>
+```
And this is **strong**
+```{=html}
</td>
+```
+```{=html}
</tr>
+```
+```{=html}
</table>
+```
+```{=html}
<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
-
+```
Here's a simple block:
<div>
@@ -447,41 +464,64 @@ foo
This should just be an HTML comment:
+```{=html}
<!-- Comment -->
-
+```
Multiline:
+```{=html}
<!--
Blah
Blah
-->
+```
+```{=html}
<!--
This is another comment.
-->
-
+```
Code block:
<!-- Comment -->
Just plain comment, with trailing spaces on the line:
+```{=html}
<!-- foo -->
-
+```
Code:
<hr />
Hr's:
+```{=html}
<hr>
+```
+```{=html}
<hr />
+```
+```{=html}
<hr />
+```
+```{=html}
<hr>
+```
+```{=html}
<hr />
+```
+```{=html}
<hr />
+```
+```{=html}
<hr class="foo" id="bar" />
+```
+```{=html}
<hr class="foo" id="bar" />
+```
+```{=html}
<hr class="foo" id="bar">
+```
------------------------------------------------------------------------------
@@ -540,7 +580,7 @@ Ellipses...and...and....
LaTeX
=====
-- \cite[22-23]{smith.1899}
+- `\cite[22-23]{smith.1899}`{=tex}
- $2+2=4$
- $x \in y$
- $\alpha \wedge \omega$
@@ -560,11 +600,13 @@ These shouldn't be math:
Here's a LaTeX table:
+```{=tex}
\begin{tabular}{|l|l|}\hline
Animal & Number \\ \hline
Dog & 2 \\
Cat & 1 \\ \hline
\end{tabular}
+```
------------------------------------------------------------------------------