diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-04 10:31:06 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-04 14:56:57 -0800 |
commit | ae60e0196c5c12d358002cf3251dfebf07c66da6 (patch) | |
tree | 7c3bc1c605e6e65dbe4fe0071580e6ac92de5c00 /test/command | |
parent | c58ecde93737aa68bd5dda9c4c72193dcaab3cf0 (diff) | |
download | pandoc-ae60e0196c5c12d358002cf3251dfebf07c66da6.tar.gz |
Add `empty_paragraphs` extension.
* Deprecate `--strip-empty-paragraphs` option. Instead we now
use an `empty_paragraphs` extension that can be enabled on
the reader or writer. By default, disabled.
* Add `Ext_empty_paragraphs` constructor to `Extension`.
* Revert "Docx reader: don't strip out empty paragraphs."
This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b.
* Implement `empty_paragraphs` extension in docx reader and writer,
opendocument writer, html reader and writer.
* Add tests for `empty_paragraphs` extension.
Diffstat (limited to 'test/command')
-rw-r--r-- | test/command/2649.md | 9 | ||||
-rw-r--r-- | test/command/3494.md | 3 | ||||
-rw-r--r-- | test/command/empty_paragraphs.md | 95 |
3 files changed, 99 insertions, 8 deletions
diff --git a/test/command/2649.md b/test/command/2649.md index af84693c4..8f594cfe1 100644 --- a/test/command/2649.md +++ b/test/command/2649.md @@ -88,20 +88,17 @@ </tr> <tr class="even"> <td><p>1</p></td> -<td> -<p><a href="Sébastien_Loeb" title="wikilink">Sébastien Loeb</a></p></td> +<td><p><a href="Sébastien_Loeb" title="wikilink">Sébastien Loeb</a></p></td> <td><p>78</p></td> </tr> <tr class="odd"> <td><p>2</p></td> -<td> -<p><strong><a href="Sébastien_Ogier" title="wikilink">Sébastien Ogier</a></strong></p></td> +<td><p><strong><a href="Sébastien_Ogier" title="wikilink">Sébastien Ogier</a></strong></p></td> <td><p>38</p></td> </tr> <tr class="even"> <td><p>10</p></td> -<td> -<p><a href="Hannu_Mikkola" title="wikilink">Hannu Mikkola</a></p></td> +<td><p><a href="Hannu_Mikkola" title="wikilink">Hannu Mikkola</a></p></td> <td><p>18</p></td> </tr> </tbody> diff --git a/test/command/3494.md b/test/command/3494.md index 534041246..249973fb3 100644 --- a/test/command/3494.md +++ b/test/command/3494.md @@ -25,8 +25,7 @@ <td style="text-align: left;">thank you</td> </tr> <tr class="odd"> -<td style="text-align: right;"> -<p><em>blah</em></p></td> +<td style="text-align: right;"><p><em>blah</em></p></td> <td style="text-align: left;"><em>blah</em></td> <td style="text-align: left;"><em>blah</em></td> </tr> diff --git a/test/command/empty_paragraphs.md b/test/command/empty_paragraphs.md new file mode 100644 index 000000000..3064d3f7d --- /dev/null +++ b/test/command/empty_paragraphs.md @@ -0,0 +1,95 @@ +``` +% pandoc -f native -t docx | pandoc -f docx -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx+empty_paragraphs | pandoc -f docx -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx | pandoc -f docx+empty_paragraphs -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx+empty_paragraphs | pandoc -f docx+empty_paragraphs -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [] +,Para [] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t html5 +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<p>hi</p> + + +<p>lo</p> +``` + +``` +% pandoc -f native -t html5+empty_paragraphs +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +``` + +``` +% pandoc -f html+empty_paragraphs -t native +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +^D +[Para [Str "hi"] +,Para [] +,Para [] +,Para [Str "lo"]] +``` + +``` +% pandoc -f html -t native +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t opendocument+empty_paragraphs +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<text:p text:style-name="Text_20_body">hi</text:p> +<text:p text:style-name="Text_20_body"></text:p> +<text:p text:style-name="Text_20_body"></text:p> +<text:p text:style-name="Text_20_body">lo</text:p> +``` + +``` +% pandoc -f native -t opendocument +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<text:p text:style-name="Text_20_body">hi</text:p> +<text:p text:style-name="Text_20_body">lo</text:p> +``` |