Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML br tags are inserted before each line within EX/EE man macros #163

Open
gokcehan opened this issue Aug 19, 2023 · 2 comments
Open

HTML br tags are inserted before each line within EX/EE man macros #163

gokcehan opened this issue Aug 19, 2023 · 2 comments

Comments

@gokcehan
Copy link

We have a man page for lf that we maintain using man macros. We wrap code snippets and monospace verbatim contents within .EX and .EE macros. It seems that debiman inserts <br/> tags before each line when rendering these contents.

For example, we have the following in the man page:

.PP
The following commands/keybindings are provided by default:
.PP
.EX
    Unix                     Windows
    cmd open &$OPENER "$f"   cmd open &%OPENER% %f%
    map e $$EDITOR "$f"      map e $%EDITOR% %f%
    map i $$PAGER "$f"       map i !%PAGER% %f%
    map w $$SHELL            map w $%SHELL%
.EE

Output of this section is as follows:

<p class="Pp">The following commands/keybindings are provided by default:</p>
<p class="Pp"></p>
<pre><br/>
    Unix                     Windows
<br/>
    cmd open &amp;$OPENER &#34;$f&#34;   cmd open &amp;%OPENER% %f%
<br/>
    map e $$EDITOR &#34;$f&#34;      map e $%EDITOR% %f%
<br/>
    map i $$PAGER &#34;$f&#34;       map i !%PAGER% %f%
<br/>
    map w $$SHELL            map w $%SHELL%
</pre>

The rendered output currently shows up as follows:

image

When I tried mandoc myself on my machine, no such extra <br/> tags are inserted:

<div class="Pp"></div>
The following commands/keybindings are provided by default:
<div class="Pp"></div>
<pre>
    Unix                          Windows
    cmd open &amp;$OPENER &quot;$f&quot;        cmd open &amp;%OPENER% %f%
    map e $$EDITOR &quot;$f&quot;           map e $%EDITOR% %f%
    map i $$PAGER &quot;$f&quot;            map i !%PAGER% %f%
    map w $$SHELL                 map w $%SHELL%
    cmd doc $$lf -doc | $PAGER    cmd doc !%lf% -doc | %PAGER%
    map &lt;f-1&gt; doc                 map &lt;f-1&gt; doc
</pre>

Is there are reason debiman inserts those extra <br/> tags? If this is working as intended, then is there a workaround to avoid these <br/> tags?

I have looked at other man page hosts and it seems that the arch man page for lf also have these extra <br/> tags. It seems that this behavior is previously reported and it is currently marked as a bug. Arch linux also seems to use mandoc so maybe it could be related.

@stapelberg
Copy link
Contributor

Can you test if you can reproduce this problem directly using mandoc?

If so, please report this issue upstream with mandoc.

I don’t currently have time to look into this in any capacity. Sorry.

@gokcehan
Copy link
Author

@stapelberg Extra <br/> tags are not inserted when I run mandoc myself. You can see the output with regular mandoc in my original post. That is executed with mandoc -Ofragment -Thtml lf.1 which I think has the same arguments used in debiman.

It's no problem if you don't have time to look at this. I might take a look at this myself if I find some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants