Ihor Radchenko <[email protected]> writes:

>>   @node name should not contain `,': Capture, Refile, Archive

> Honestly, this texinfo warning looks like Texinfo bug.

The Texinfo manual clearly state:

  Unfortunately, you cannot reliably use periods, commas, or colons
  within a node name; [...] If you insist on using these characters in
  node names, [...] you must still escape those characters, by using
  either special insertions (see Inserting ‘,’ with @comma{}) or @asis
  (see @asis).

  
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Node-Line-Requirements.html

Also, @node arguments are separated by comma.

> Why is it not allowed to have commas in heading? That makes no sense
> from user perspective.

Node identifiers different from headings:

  @node Summary
  @section Summary

Here, @node is used for identification (e.g. anchors, URLs) while
@section is used as the section title (e.g. H2s in HTML).

This seems to be a bug in the Org Texinfo exporter.  The following
function should kick in:

  (defun org-texinfo--sanitize-node (title)
    "Bend string TITLE to node line requirements.
  Trim string and collapse multiple whitespace characters as they
  are not significant.  Replace leading left parenthesis, when
  followed by a right parenthesis, with a square bracket.  Remove
  periods, commas and colons."
    (org-trim
     (replace-regexp-in-string
      "[ \t]+" " "
      (replace-regexp-in-string
       "[:,.]" ""
       (replace-regexp-in-string "\\`(\\(.*?)\\)" "[\\1" title)))))

Rudy
-- 
"For every problem you can't solve, there's a simpler problem that you
also can't solve."

--- Hendrik Lenstra

Rudolf Adamkovič <[email protected]> [he/him]
http://adamkovic.org

Reply via email to