From 7a9832166e36f77402d5e0259647e9f5c7ba4e58 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Dec 2021 13:44:03 -0800 Subject: Add text wrapping to HTML output. Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764. --- test/command/262.md | 3 ++- test/command/2649.md | 9 ++++++--- test/command/3523.md | 8 ++++++-- test/command/3534.md | 15 +++++++++++---- test/command/3577.md | 9 ++++++--- test/command/3701.md | 3 ++- test/command/3752.md | 18 ++++++++++++------ test/command/3840.md | 3 ++- test/command/4012.md | 3 ++- test/command/4186.md | 3 ++- test/command/4235.md | 10 +++++++--- test/command/4639.md | 2 +- test/command/4677.md | 3 ++- test/command/4743.md | 4 +++- test/command/512.md | 3 ++- test/command/5121.md | 3 ++- test/command/5627.md | 12 ++++++++---- test/command/5642.md | 3 ++- test/command/5650.md | 6 ++++-- test/command/5655.md | 10 ++++++++-- test/command/5813.md | 3 ++- test/command/5986.md | 3 ++- test/command/6739.md | 3 ++- test/command/7006.md | 9 ++++++--- test/command/7416.md | 6 ++++-- test/command/7568.md | 7 ++++++- test/command/7713.md | 3 ++- test/command/853.md | 6 ++++-- test/command/video-audio.md | 10 +++++++--- 29 files changed, 125 insertions(+), 55 deletions(-) (limited to 'test/command') diff --git a/test/command/262.md b/test/command/262.md index bda2acb35..61af20ede 100644 --- a/test/command/262.md +++ b/test/command/262.md @@ -5,7 +5,8 @@ .. _hello: .. _goodbye: example.com ^D -

hello and goodbye

+

hello and goodbye

``` ``` diff --git a/test/command/2649.md b/test/command/2649.md index 52ae16ce4..4ab059ea0 100644 --- a/test/command/2649.md +++ b/test/command/2649.md @@ -90,17 +90,20 @@

1

-

Sébastien Loeb

+

Sébastien +Loeb

78

2

-

Sébastien Ogier

+

Sébastien +Ogier

38

10

-

Hannu Mikkola

+

Hannu +Mikkola

18

diff --git a/test/command/3523.md b/test/command/3523.md index cb0089489..c3574943c 100644 --- a/test/command/3523.md +++ b/test/command/3523.md @@ -19,8 +19,12 @@ \end{document} ^D
-

Das Recht hat kein Dasein für sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen.

-

Das Recht hat kein Dasein für sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen.

+

Das Recht hat kein Dasein für sich, sein Wesen vielmehr +ist das Leben des Menschen selbst, von einer besonderen Seite +angesehen.

+

Das Recht hat kein Dasein für sich, sein Wesen vielmehr +ist das Leben des Menschen selbst, von einer besonderen Seite +angesehen.

This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
 
-

Still in the shallower list element since the preceding example block forced the deeper list element to terminate.

+

Still in the shallower list element since the preceding example block +forced the deeper list element to terminate.

Outside all lists.

``` diff --git a/test/command/4235.md b/test/command/4235.md index 4f2644dd6..5b534b6d7 100644 --- a/test/command/4235.md +++ b/test/command/4235.md @@ -2,11 +2,15 @@ % pandoc --id-prefix=foo This.^[Has a footnote.] ^D -

This.1

-
+

This.1

+

    -
  1. Has a footnote.↩︎

  2. +
  3. Has a footnote.↩︎

``` diff --git a/test/command/4639.md b/test/command/4639.md index c35df1749..31ac3a5d9 100644 --- a/test/command/4639.md +++ b/test/command/4639.md @@ -5,6 +5,6 @@ \end{equation} ^D

\[\begin{equation} - E=mc^2 +E=mc^2 \end{equation}\]

``` diff --git a/test/command/4677.md b/test/command/4677.md index 2694624b9..64c436005 100644 --- a/test/command/4677.md +++ b/test/command/4677.md @@ -3,6 +3,7 @@ ![Caption](img.png){#img:1} ^D
-Caption +Caption +
``` diff --git a/test/command/4743.md b/test/command/4743.md index 582540736..a75ec1078 100644 --- a/test/command/4743.md +++ b/test/command/4743.md @@ -41,5 +41,7 @@ My:thumbsup:emoji:heart: My:thumbsup:emoji:heart:x :hearts: xyz ^D

0️⃣ header

-

My👍emoji❤️x ♥️ xyz

+

My👍emoji❤️x ♥️ xyz

``` diff --git a/test/command/512.md b/test/command/512.md index b95921309..21b3ea9a7 100644 --- a/test/command/512.md +++ b/test/command/512.md @@ -8,7 +8,8 @@ __ link1_ __ link2_ ^D -

click here or click here

+

click here or click here

``` Multiple indirection: diff --git a/test/command/5121.md b/test/command/5121.md index 1ee6bda77..f1b972fb4 100644 --- a/test/command/5121.md +++ b/test/command/5121.md @@ -5,7 +5,8 @@ ## Header 2 ^D
-My caption +My caption +
## Header 2 diff --git a/test/command/5627.md b/test/command/5627.md index 9910e76c5..dde4c99d6 100644 --- a/test/command/5627.md +++ b/test/command/5627.md @@ -20,8 +20,10 @@ Something
  • Two -->something<!--
  • Three
  • -
    --><!--<script>alert('Escaped!')</script>
    -
    Something
    +
    --><!--<script>alert('Escaped!')</script>
    +
    Something
    ``` ``` @@ -46,8 +48,10 @@ Something
  • -->something<!--
  • bye -->something else<!--
  • -
    --><!--<script>alert('Escaped!')</script>
    -
    Something
    +
    --><!--<script>alert('Escaped!')</script>
    +
    Something
    ``` ``` diff --git a/test/command/5642.md b/test/command/5642.md index cd60df812..120a88ada 100644 --- a/test/command/5642.md +++ b/test/command/5642.md @@ -3,6 +3,7 @@ ![test](foo){aria-describedby="barbaz"} ^D
    -test +test +
    ``` diff --git a/test/command/5650.md b/test/command/5650.md index a2dd215bc..1e96aeaa4 100644 --- a/test/command/5650.md +++ b/test/command/5650.md @@ -5,7 +5,8 @@ a b ``` ^D -
    a
    +
    a
     b
    ```` @@ -16,7 +17,8 @@ a b ``` ^D -
    a
    +
    a
     b
    ```` diff --git a/test/command/5655.md b/test/command/5655.md index 692009562..72ad46e5e 100644 --- a/test/command/5655.md +++ b/test/command/5655.md @@ -2,13 +2,19 @@ % pandoc --webtex $T_n={n+1 \choose 2}$ ^D -

    T_n={n+1 \choose 2}

    +

    ```` ```` % pandoc --webtex $$T_n={n+1 \choose 2}$$ ^D -

    T_n={n+1 \choose 2}

    +

    ```` diff --git a/test/command/5813.md b/test/command/5813.md index 927a161ed..51f774524 100644 --- a/test/command/5813.md +++ b/test/command/5813.md @@ -2,5 +2,6 @@ % pandoc -f gfm ### Jekyll Plugins & Gems :gem: ^D -

    Jekyll Plugins & Gems 💎

    +

    Jekyll Plugins & Gems 💎

    ``` diff --git a/test/command/5986.md b/test/command/5986.md index c181e33ad..aaa1e6568 100644 --- a/test/command/5986.md +++ b/test/command/5986.md @@ -6,7 +6,8 @@

    diff --git a/test/command/6739.md b/test/command/6739.md index 7c9ed24a2..ff2d4bc75 100644 --- a/test/command/6739.md +++ b/test/command/6739.md @@ -4,7 +4,8 @@ * `--argA | --argB` This item has a pipe character ^D
      -
    • --argument This item does not have a pipe character
    • +
    • --argument This item does not have a pipe +character
    • --argA | --argB This item has a pipe character
    ``` diff --git a/test/command/7006.md b/test/command/7006.md index 7e2215cdf..22aaf84ad 100644 --- a/test/command/7006.md +++ b/test/command/7006.md @@ -6,13 +6,16 @@ Test.[^fn] ![Caption.](/image.jpg) ^D -

    Test.1

    -
    +

    Test.1

    +

    1. Foo:

      -Caption. +Caption. +
      ↩︎
    diff --git a/test/command/7416.md b/test/command/7416.md index 2f9577f10..d440725ab 100644 --- a/test/command/7416.md +++ b/test/command/7416.md @@ -4,7 +4,8 @@ ^D
    -alt
    caption
    +alt +
    caption
    ``` @@ -14,6 +15,7 @@ ^D
    -caption +caption +
    ``` diff --git a/test/command/7568.md b/test/command/7568.md index 42f1e37b1..487da0861 100644 --- a/test/command/7568.md +++ b/test/command/7568.md @@ -7,5 +7,10 @@ holds a useful spot. .. _Labyrinth Lord\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition ^D -

    While Labyrinth Lord: Revised Edition (LLRE; PDF and POD) has been criticized for not being a completely faithful retro-clone of the Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still holds a useful spot.

    +

    While Labyrinth +Lord: Revised Edition (LLRE; PDF and POD) has been criticized for +not being a completely faithful retro-clone of the Moldvay/Cook/Marsh +Basic/Expert D&D rules (B/X), I think it still holds a useful +spot.

    ``` diff --git a/test/command/7713.md b/test/command/7713.md index d42dcd9b8..851cb4729 100644 --- a/test/command/7713.md +++ b/test/command/7713.md @@ -21,7 +21,8 @@ -cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc +cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc +cccccccccc diff --git a/test/command/853.md b/test/command/853.md index 54eb416a9..bcc3b4654 100644 --- a/test/command/853.md +++ b/test/command/853.md @@ -7,11 +7,13 @@ Here is a citation reference: [CIT2002]_. .. [CIT2002] This is the citation. It's just like a footnote, except the label is textual. ^D -

    Here is a citation reference: [CIT2002].

    +

    Here is a citation reference: [CIT2002].

    CIT2002
    -

    This is the citation. It's just like a footnote, except the label is textual.

    +

    This is the citation. It's just like a footnote, except the label +is textual.

    diff --git a/test/command/video-audio.md b/test/command/video-audio.md index 451b614d8..4fbd58db3 100644 --- a/test/command/video-audio.md +++ b/test/command/video-audio.md @@ -10,9 +10,13 @@ ![](./test.jpg) ^D -

    -

    -

    +

    +

    +

    ``` -- cgit v1.2.3