On Mon, Mar 09, 2026 at 12:41:27PM +0000, Werner LEMBERG wrote:
> 
> [2051fde55ac67d92c0532c0483a657aef092b6cb]
> 
> 
> Consider the following input.
> 
> ```
> \input texinfo
> 
> @top Top
> 
> (@uref{https://foo.bar/baz.html,
>        baz})
> 
> (@uref{https://foo.bar/baz.html, baz})
> 
> @bye
> ```
> 
> If I process this with `texi2any --html`, I get the following in the
> output
> 
> ```
> <p>(<a class="uref" href="https://foo.bar/baz.html";>       baz</a>)
> </p>
> <p>(<a class="uref" href="https://foo.bar/baz.html";>baz</a>)
> </p>
> ```
> 
> Why is there a difference in whitespace handling?  This smells like a
> bug.

I think they should be both output as the second output, with the whitespace
skipped on the new line before "baz".  I notice they are both output the same
with texinfo.tex.

In the Info output, in the first usage, a single " " is output before
the "baz", thus: '( baz (https://foo.bar/baz.html))'.

In the tree output, the output is this:

$ TEXINFO_OUTPUT_FORMAT=debugtree ../tta/perl/texi2any.pl test.texi
document_root 
 before_node_section 
  preamble_before_beginning 
   text_before_beginning |\input texinfo\n|
   text_before_beginning |\n|
   text_before_beginning |\n|
  preamble_before_content 
  paragraph 
   |(|
   @uref 
    brace_arg 
     |https://foo.bar/baz.html|
    brace_arg  b/\n/
     |       baz|
   |)\n|
  empty_line |\n|
  paragraph 
   |(|
   @uref 
    brace_arg 
     |https://foo.bar/baz.html|
    brace_arg  b/ /
     |baz|
   |)\n|
  empty_line |\n|
 @bye 
  line_arg  a/\n/
 postamble_after_end 
  text_after_end |\n|


First usage:

    brace_arg  b/\n/
     |       baz|


Second usage:

    brace_arg  b/ /
     |baz|

I believe the text inside b/.../ refers to whitespace "before" the
argument, which is ignored.

I expect the leading spaces on the next line should be included inside
this "before" whitespace, so it should be parsed as:

    brace_arg  b/\n       /
     |baz|

Hopefully Patrice will comment.

Reply via email to