aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-04-16 22:13:29 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2021-04-16 22:47:37 +0200
commit5f79a66ed64e9b0cc326e467dcb17239f1596fcc (patch)
treea6389603b3580ecc84bf34b65a9205fc97858a8b /test
parent2e7fee9c3c48e2492340a38d3a387e4f9ea0c913 (diff)
downloadpandoc-5f79a66ed64e9b0cc326e467dcb17239f1596fcc.tar.gz
JATS writer: reduce unnecessary use of <p> elements for wrapping
The `<p>` element is used for wrapping in cases were the contents would otherwise not be allowed in a certain context. Unnecessary wrapping is avoided, especially around quotes (`<disp-quote>` elements). Closes: #7227
Diffstat (limited to 'test')
-rw-r--r--test/command/7041.md23
-rw-r--r--test/writer.jats_archiving68
-rw-r--r--test/writer.jats_articleauthoring88
-rw-r--r--test/writer.jats_publishing68
4 files changed, 119 insertions, 128 deletions
diff --git a/test/command/7041.md b/test/command/7041.md
new file mode 100644
index 000000000..1773963b8
--- /dev/null
+++ b/test/command/7041.md
@@ -0,0 +1,23 @@
+```
+% pandoc -f html -t jats
+<table>
+ <tr><td><blockquote>Fly, you fools!</blockquote></td></tr>
+</table>
+^D
+<table-wrap>
+ <table>
+ <colgroup>
+ <col width="100%" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td><p specific-use="wrapper">
+ <disp-quote>
+ <p>Fly, you fools!</p>
+ </disp-quote>
+ </p></td>
+ </tr>
+ </tbody>
+ </table>
+</table-wrap>
+```
diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving
index 332b5d3fd..70e15b6b8 100644
--- a/test/writer.jats_archiving
+++ b/test/writer.jats_archiving
@@ -78,39 +78,31 @@ Gruber’s markdown test suite.</p>
<sec id="block-quotes">
<title>Block Quotes</title>
<p>E-mail style:</p>
- <p specific-use="wrapper">
+ <disp-quote>
+ <p>This is a block quote. It is pretty short.</p>
+ </disp-quote>
+ <disp-quote>
+ <p>Code in a block quote:</p>
+ <preformat>sub status {
+ print &quot;working&quot;;
+}</preformat>
+ <p>A list:</p>
+ <list list-type="order">
+ <list-item>
+ <p>item one</p>
+ </list-item>
+ <list-item>
+ <p>item two</p>
+ </list-item>
+ </list>
+ <p>Nested block quotes:</p>
<disp-quote>
- <p>This is a block quote. It is pretty short.</p>
+ <p>nested</p>
</disp-quote>
- </p>
- <p specific-use="wrapper">
<disp-quote>
- <p>Code in a block quote:</p>
- <preformat>sub status {
- print &quot;working&quot;;
-}</preformat>
- <p>A list:</p>
- <list list-type="order">
- <list-item>
- <p>item one</p>
- </list-item>
- <list-item>
- <p>item two</p>
- </list-item>
- </list>
- <p>Nested block quotes:</p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
+ <p>nested</p>
</disp-quote>
- </p>
+ </disp-quote>
<p>This should not be a block quote: 2 &gt; 1.</p>
<p>And a following paragraph.</p>
</sec>
@@ -837,12 +829,10 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
</list-item>
</list>
<p>An e-mail address: <email>nobody@nowhere.net</email></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Blockquoted:
- <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Blockquoted:
+ <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
+ </disp-quote>
<p>Auto-links should not occur here:
<monospace>&lt;http://example.com/&gt;</monospace></p>
<preformat>or here: &lt;http://example.com/&gt;</preformat>
@@ -866,11 +856,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<italic>not</italic> be a footnote reference, because it contains a
space.[^my note] Here is an inline
note.<xref ref-type="fn" rid="fn3">3</xref></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Notes can go in quotes.<xref ref-type="fn" rid="fn4">4</xref></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Notes can go in quotes.<xref ref-type="fn" rid="fn4">4</xref></p>
+ </disp-quote>
<list list-type="order">
<list-item>
<p>And in list items.<xref ref-type="fn" rid="fn5">5</xref></p>
diff --git a/test/writer.jats_articleauthoring b/test/writer.jats_articleauthoring
index 956a30faa..59485a114 100644
--- a/test/writer.jats_articleauthoring
+++ b/test/writer.jats_articleauthoring
@@ -67,43 +67,39 @@ Gruber’s markdown test suite.</p>
<sec id="block-quotes">
<title>Block Quotes</title>
<p>E-mail style:</p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>This is a block quote. It is pretty short.</p>
- </disp-quote>
- </p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Code in a block quote:</p>
- <p specific-use="wrapper">
- <preformat>sub status {
+ <disp-quote>
+ <p>This is a block quote. It is pretty short.</p>
+ </disp-quote>
+ <disp-quote>
+ <p>Code in a block quote:</p>
+ <p specific-use="wrapper">
+ <preformat>sub status {
print &quot;working&quot;;
}</preformat>
- </p>
- <p>A list:</p>
- <p specific-use="wrapper">
- <list list-type="order">
- <list-item>
- <p>item one</p>
- </list-item>
- <list-item>
- <p>item two</p>
- </list-item>
- </list>
- </p>
- <p>Nested block quotes:</p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
- </disp-quote>
- </p>
+ </p>
+ <p>A list:</p>
+ <p specific-use="wrapper">
+ <list list-type="order">
+ <list-item>
+ <p>item one</p>
+ </list-item>
+ <list-item>
+ <p>item two</p>
+ </list-item>
+ </list>
+ </p>
+ <p>Nested block quotes:</p>
+ <p specific-use="wrapper">
+ <disp-quote>
+ <p>nested</p>
+ </disp-quote>
+ </p>
+ <p specific-use="wrapper">
+ <disp-quote>
+ <p>nested</p>
+ </disp-quote>
+ </p>
+ </disp-quote>
<p>This should not be a block quote: 2 &gt; 1.</p>
<p>And a following paragraph.</p>
</sec>
@@ -817,12 +813,10 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
</list-item>
</list>
<p>An e-mail address: <email>nobody@nowhere.net</email></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Blockquoted:
- <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Blockquoted:
+ <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
+ </disp-quote>
<p>Auto-links should not occur here:
<monospace>&lt;http://example.com/&gt;</monospace></p>
<preformat>or here: &lt;http://example.com/&gt;</preformat>
@@ -860,13 +854,11 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
and <monospace>]</monospace> verbatim characters, as well as [bracketed
text].</p>
</fn></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Notes can go in quotes.<fn>
- <p>In quote.</p>
- </fn></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Notes can go in quotes.<fn>
+ <p>In quote.</p>
+ </fn></p>
+ </disp-quote>
<list list-type="order">
<list-item>
<p>And in list items.<fn>
diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing
index f53fd554d..e6db4172a 100644
--- a/test/writer.jats_publishing
+++ b/test/writer.jats_publishing
@@ -78,39 +78,31 @@ Gruber’s markdown test suite.</p>
<sec id="block-quotes">
<title>Block Quotes</title>
<p>E-mail style:</p>
- <p specific-use="wrapper">
+ <disp-quote>
+ <p>This is a block quote. It is pretty short.</p>
+ </disp-quote>
+ <disp-quote>
+ <p>Code in a block quote:</p>
+ <preformat>sub status {
+ print &quot;working&quot;;
+}</preformat>
+ <p>A list:</p>
+ <list list-type="order">
+ <list-item>
+ <p>item one</p>
+ </list-item>
+ <list-item>
+ <p>item two</p>
+ </list-item>
+ </list>
+ <p>Nested block quotes:</p>
<disp-quote>
- <p>This is a block quote. It is pretty short.</p>
+ <p>nested</p>
</disp-quote>
- </p>
- <p specific-use="wrapper">
<disp-quote>
- <p>Code in a block quote:</p>
- <preformat>sub status {
- print &quot;working&quot;;
-}</preformat>
- <p>A list:</p>
- <list list-type="order">
- <list-item>
- <p>item one</p>
- </list-item>
- <list-item>
- <p>item two</p>
- </list-item>
- </list>
- <p>Nested block quotes:</p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>nested</p>
- </disp-quote>
- </p>
+ <p>nested</p>
</disp-quote>
- </p>
+ </disp-quote>
<p>This should not be a block quote: 2 &gt; 1.</p>
<p>And a following paragraph.</p>
</sec>
@@ -837,12 +829,10 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
</list-item>
</list>
<p>An e-mail address: <email>nobody@nowhere.net</email></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Blockquoted:
- <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Blockquoted:
+ <ext-link ext-link-type="uri" xlink:href="http://example.com/">http://example.com/</ext-link></p>
+ </disp-quote>
<p>Auto-links should not occur here:
<monospace>&lt;http://example.com/&gt;</monospace></p>
<preformat>or here: &lt;http://example.com/&gt;</preformat>
@@ -866,11 +856,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<italic>not</italic> be a footnote reference, because it contains a
space.[^my note] Here is an inline
note.<xref ref-type="fn" rid="fn3">3</xref></p>
- <p specific-use="wrapper">
- <disp-quote>
- <p>Notes can go in quotes.<xref ref-type="fn" rid="fn4">4</xref></p>
- </disp-quote>
- </p>
+ <disp-quote>
+ <p>Notes can go in quotes.<xref ref-type="fn" rid="fn4">4</xref></p>
+ </disp-quote>
<list list-type="order">
<list-item>
<p>And in list items.<xref ref-type="fn" rid="fn5">5</xref></p>