Skip to content

commit 152ad343c can break verbatim #11387

@duncan-roe

Description

@duncan-roe

Describe the bug
In response to issue #11371, commit 152ad34 modifies src/mandocvisitor.cpp to remove newlines from the input stream if an odd number of double-quotes have been encountered. When this is done inside a \verbatim section, lines may get joined so the output is no longer verbatim.
You can see this happen in reproducer3.tar.gz that came with #11371.

Screenshots
Here is the code in question:

* ### HTML o/p
*
* HTML performs the same operation on the output as MAN does:
* \verbatim
<p>"line 47 starts a double-quoted line sequence.
   line 48 is a regular line following a line with an unpaired...
\endverbatim
 * but html condenses the whitespace sequence "Nl Sp Sp Sp" to a single "Sp".

This is how man in an 80-column window rendered the above code before commit 152ad34

   HTML o/p
       HTML performs the same operation on the output as MAN does:

       <p>"line 47 starts a double-quoted line sequence.
          line 48 is a regular line following a line with an unpaired...

        but html condenses the whitespace sequence "Nl Sp Sp Sp" to a single
       "Sp".

This is how man renders it now

   HTML o/p
       HTML performs the same operation on the output as MAN does:

       <p>"line 47 starts a double-quoted line sequence.   line 48 is a regular
line following a line with an unpaired...

        but html condenses the whitespace sequence "Nl Sp Sp Sp" to a single
       "Sp".

To Reproduce
reproducer3.tar.gz

Expected behavior
When inside double-quotes:

  • I thought it was perfectly reasonable for man to preserve newlines in quoted line sequences since man preserves other whitespace (e.g. multiple spaces are preserved). But perhaps the preserved newlines were an unintentional consequence of the leading whitespace (and I think 3 leading spaces was not intended either).
  • I would really like to see a quoted newline transfer to the output followed by a .br line then the next line only indented as much as the user did (if at all).

Version
1.14.0 (2a4d39e*)

Additional context
I originally set out to document the action of double-quote. But I need to know what behaviour is intended before I can proceed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions