discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc inserts extraneous <br> tags inside <pre>
@ 2022-06-25 16:28 Mohamed Akram
  2022-06-26 11:16 ` Ingo Schwarze
  0 siblings, 1 reply; 5+ messages in thread
From: Mohamed Akram @ 2022-06-25 16:28 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

Hi folks,

Thanks for this great and useful tool. I did notice a bug however in mandoc when using HTML output. It seems to insert <br> tags inside <pre> sections, which causes there to be double newlines since <pre> already preserves newlines. You can see it in this example which has many code samples in it:

curl https://raw.githubusercontent.com/apple-oss-distributions/tcl/tcl-134.121.2/tcl_ext/expect/expect/expect.man | mandoc -T html >example.html

[-- Attachment #2: Type: text/html, Size: 1178 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mandoc inserts extraneous <br> tags inside <pre>
  2022-06-25 16:28 mandoc inserts extraneous <br> tags inside <pre> Mohamed Akram
@ 2022-06-26 11:16 ` Ingo Schwarze
  2022-06-26 16:41   ` Mohamed Akram
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Schwarze @ 2022-06-26 11:16 UTC (permalink / raw)
  To: Mohamed Akram; +Cc: discuss

Hello Mohamed,

Mohamed Akram wrote on Sat, Jun 25, 2022 at 04:28:18PM +0000:

> Thanks for this great and useful tool.

You are welcome.

> I did notice a bug however in mandoc when using HTML output.
> It seems to insert <br> tags inside <pre> sections, which causes
> there to be double newlines since <pre> already preserves newlines.
> You can see it in this example which has many code samples in it:
> 
> curl https://raw.githubusercontent.com/apple-oss-distributions/tcl/tcl-134.121.2/tcl_ext/expect/expect/expect.man | mandoc -T html >example.html

I believe that is the following bug already listed in the mandoc TODO file:

- HTML formatting of .nf should avoid <br/>
  and not close and re-open <pre> on .P
  my mail to ports@ 27 Jun 2021 16:09:20 +0200
  loc **  exist **  algo *  size *  imp **

I'm expanding the entry a bit to read:

- HTML formatting of .nf should avoid <br/>,
  even when input lines start with whitespace,
  and not close and re-open <pre> on .P
  my mail to ports@ 27 Jun 2021 16:09:20 +0200
  reported again by Mohamed Akram 25 Jun 2022 16:28:18 +0000
  loc **  exist **  algo *  size *  imp **

This is one among the bugs likely to get addressed during the next round
of less-important bug fixes.  It is less important in so far as a few
bugs that can crash mandoc are still open.  There is no specific time
frame, but a delay of a few more months is likely.

Thanks for reporting!

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mandoc inserts extraneous <br> tags inside <pre>
  2022-06-26 11:16 ` Ingo Schwarze
@ 2022-06-26 16:41   ` Mohamed Akram
  2022-06-26 17:02     ` Ingo Schwarze
  0 siblings, 1 reply; 5+ messages in thread
From: Mohamed Akram @ 2022-06-26 16:41 UTC (permalink / raw)
  To: Ingo Schwarze; +Cc: discuss

Hi Ingo,

Thanks for your response. I did skim the TODO but I think I wasn’t sure if that was the same bug. I’ll keep an eye out for a new release.

Mohamed

> On Jun 26, 2022, at 3:16 PM, Ingo Schwarze <schwarze@usta.de> wrote:
> 
> Hello Mohamed,
> 
> Mohamed Akram wrote on Sat, Jun 25, 2022 at 04:28:18PM +0000:
> 
>> Thanks for this great and useful tool.
> 
> You are welcome.
> 
>> I did notice a bug however in mandoc when using HTML output.
>> It seems to insert <br> tags inside <pre> sections, which causes
>> there to be double newlines since <pre> already preserves newlines.
>> You can see it in this example which has many code samples in it:
>> 
>> curl https://raw.githubusercontent.com/apple-oss-distributions/tcl/tcl-134.121.2/tcl_ext/expect/expect/expect.man | mandoc -T html >example.html
> 
> I believe that is the following bug already listed in the mandoc TODO file:
> 
> - HTML formatting of .nf should avoid <br/>
>  and not close and re-open <pre> on .P
>  my mail to ports@ 27 Jun 2021 16:09:20 +0200
>  loc **  exist **  algo *  size *  imp **
> 
> I'm expanding the entry a bit to read:
> 
> - HTML formatting of .nf should avoid <br/>,
>  even when input lines start with whitespace,
>  and not close and re-open <pre> on .P
>  my mail to ports@ 27 Jun 2021 16:09:20 +0200
>  reported again by Mohamed Akram 25 Jun 2022 16:28:18 +0000
>  loc **  exist **  algo *  size *  imp **
> 
> This is one among the bugs likely to get addressed during the next round
> of less-important bug fixes.  It is less important in so far as a few
> bugs that can crash mandoc are still open.  There is no specific time
> frame, but a delay of a few more months is likely.
> 
> Thanks for reporting!
> 
> Yours,
>  Ingo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mandoc inserts extraneous <br> tags inside <pre>
  2022-06-26 16:41   ` Mohamed Akram
@ 2022-06-26 17:02     ` Ingo Schwarze
  2022-06-26 17:29       ` Mohamed Akram
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Schwarze @ 2022-06-26 17:02 UTC (permalink / raw)
  To: Mohamed Akram; +Cc: discuss

Hi Mohamed,

Mohamed Akram wrote on Sun, Jun 26, 2022 at 04:41:18PM +0000:

> Thanks for your response. I did skim the TODO but I think I wasn’t
> sure if that was the same bug.

No problem, duplicate reports also help me prioritize because they
tell me that more people feel affected.  Then again, that's not a
guarantee that time for the fix will be found more quickly.

> I’ll keep an eye out for a new release.

It is likely that after the bug will be fixed, a few more months
may go by until the next release comes.

I'm also in the habit of notifiying bug reporters right after fixing
their bugs, such that they can pick up and use the patch until the
release comes, if they want to, and such that they can test
whether the patch really fixes the problem for them.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mandoc inserts extraneous <br> tags inside <pre>
  2022-06-26 17:02     ` Ingo Schwarze
@ 2022-06-26 17:29       ` Mohamed Akram
  0 siblings, 0 replies; 5+ messages in thread
From: Mohamed Akram @ 2022-06-26 17:29 UTC (permalink / raw)
  To: Ingo Schwarze; +Cc: discuss

> On Jun 26, 2022, at 9:02 PM, Ingo Schwarze <schwarze@usta.de> wrote:
> 
> I'm also in the habit of notifiying bug reporters right after fixing
> their bugs, such that they can pick up and use the patch until the
> release comes, if they want to, and such that they can test
> whether the patch really fixes the problem for them.

That’s really awesome. A patch would be sufficient in my case since I’m just running this on my machine. Also, if anyone else comes across this I found a little workaround in the meantime using some sed magic:

mandoc -T html file | sed '/<pre>/,/<\/pre>/{/^<br\/>$/d;}’

Mohamed

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-26 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25 16:28 mandoc inserts extraneous <br> tags inside <pre> Mohamed Akram
2022-06-26 11:16 ` Ingo Schwarze
2022-06-26 16:41   ` Mohamed Akram
2022-06-26 17:02     ` Ingo Schwarze
2022-06-26 17:29       ` Mohamed Akram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).