emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Texinfo: Commas in URL text are not escaped
@ 2024-10-09 10:43 8dcc
  2024-10-19  8:33 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: 8dcc @ 2024-10-09 10:43 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 522 bytes --]

Hello,

The following Org file:

  [[https://example.com][Foo]]

  [[https://example.com][Foo, Bar]]

When exported to Texinfo using `org-texinfo-export-to-texinfo',
generates the following file:

  ...
  @uref{https://example.com, Foo}

  @uref{https://example.com, Foo, Bar}
  ...

The comma on the text of the second URL is being interpreted by Texinfo
as an argument separator, which in the case of `@uref', only the third
argument is displayed, hiding the second argument and the actual URL
when exporting the file.


[-- Attachment #1.2: PDF screenshot (Error) --]
[-- Type: image/png, Size: 6118 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 215 bytes --]


Therefore, it should be escaped to `@comma{}', according to the Texinfo
manual[1]:

  ...
  @uref{https://example.com, Foo}

  @uref{https://example.com, Foo@comma{} Bar}
  ...

This produces the expected output.


[-- Attachment #1.4: PDF screenshot (Corrected) --]
[-- Type: image/png, Size: 9260 bytes --]

[-- Attachment #1.5: Type: text/plain, Size: 141 bytes --]


[1] Section 11.1.3, Inserting `,' with `@comma{}'.
    https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Inserting-a-Comma.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

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

* Re: [BUG] Texinfo: Commas in URL text are not escaped
  2024-10-09 10:43 [BUG] Texinfo: Commas in URL text are not escaped 8dcc
@ 2024-10-19  8:33 ` Ihor Radchenko
  2024-10-27 22:31   ` Jonas Bernoulli
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-10-19  8:33 UTC (permalink / raw)
  To: 8dcc; +Cc: emacs-orgmode

8dcc <8dcc.git@gmail.com> writes:

> When exported to Texinfo using `org-texinfo-export-to-texinfo',
> generates the following file:
>
>   ...
>   @uref{https://example.com, Foo}
>
>   @uref{https://example.com, Foo, Bar}
>   ...
>
> The comma on the text of the second URL is being interpreted by Texinfo
> as an argument separator, which in the case of `@uref', only the third
> argument is displayed, hiding the second argument and the actual URL
> when exporting the file.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=39264d3d41
Thanks for reporting!

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Texinfo: Commas in URL text are not escaped
  2024-10-19  8:33 ` Ihor Radchenko
@ 2024-10-27 22:31   ` Jonas Bernoulli
  2024-10-28 19:06     ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Bernoulli @ 2024-10-27 22:31 UTC (permalink / raw)
  To: Ihor Radchenko, 8dcc; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> 8dcc <8dcc.git@gmail.com> writes:
>
>> When exported to Texinfo using `org-texinfo-export-to-texinfo',
>> generates the following file:
>>
>>   ...
>>   @uref{https://example.com, Foo}
>>
>>   @uref{https://example.com, Foo, Bar}
>>   ...
>>
>> The comma on the text of the second URL is being interpreted by Texinfo
>> as an argument separator, which in the case of `@uref', only the third
>> argument is displayed, hiding the second argument and the actual URL
>> when exporting the file.
>
> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=39264d3d41
> Thanks for reporting!

> * lisp/ox-texinfo.el (org-texinfo--sanitize-content): Sanitize commas
> everywhere to make sure that we do not end up with text commas being
> interpreted as argument separator in @command{arg1, arg2, ...}.  This
> approach will produce @comma{} even when it is not necessary, but it
> is the safest approach.

Could you please find a more localized solution?  I would expect that
this can be done in org-texinfo-link instead.  Replacing every comma
with @comma{} makes the resulting texinfo much harder to read.

     Cheers,
     Jonas


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

* Re: [BUG] Texinfo: Commas in URL text are not escaped
  2024-10-27 22:31   ` Jonas Bernoulli
@ 2024-10-28 19:06     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-10-28 19:06 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: 8dcc, emacs-orgmode

Jonas Bernoulli <jonas@bernoul.li> writes:

>> * lisp/ox-texinfo.el (org-texinfo--sanitize-content): Sanitize commas
>> everywhere to make sure that we do not end up with text commas being
>> interpreted as argument separator in @command{arg1, arg2, ...}.  This
>> approach will produce @comma{} even when it is not necessary, but it
>> is the safest approach.
>
> Could you please find a more localized solution?  I would expect that
> this can be done in org-texinfo-link instead.  Replacing every comma
> with @comma{} makes the resulting texinfo much harder to read.

It indeed makes texinfo harder to read, but the original bug did not
only reveal problems with @uref. At least, commands like @email (or
anything else that can accept multiple arguments) are also bugged.

Unfortunately, I am not very familiar with Texinfo (and ox-texinfo does
not have a dedicated maintainer). So, given that comma appears to be
special in various Texinfo constructs, I went with the safest option
available.

If someone who knows Texinfo syntax and how comma is used there can
provide information on where exactly "," is special, it would help
creating a clearner fix.

For the time being, I judged that ugly texi sources are better than
buggy export.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-10-28 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 10:43 [BUG] Texinfo: Commas in URL text are not escaped 8dcc
2024-10-19  8:33 ` Ihor Radchenko
2024-10-27 22:31   ` Jonas Bernoulli
2024-10-28 19:06     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).