* bug#62870: Texinfo: stexi->texi: Itemize End command not in a line of its own
@ 2023-04-15 19:51 Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language
0 siblings, 0 replies; only message in thread
From: Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2023-04-15 19:51 UTC (permalink / raw)
To: 62870
[-- Attachment #1.1.1: Type: text/plain, Size: 2368 bytes --]
Hi,
The command ending an itemization (end command) is not placed in a line
of its own, but it should:
"Block commands: These commands are written at the start of a line, with
general text on following lines, terminated by a matching '@end' command
on a line of its own." — Texinfo manual, @-Command Syntax.
This happens with the "itemize" command, but not with similar block
commands like "example", "lisp", "display" and "format".
Operating system: Guix System x86_64 Kernel: 6.1.14-gnu
GNU Guile: 3.0.9
STEPS TO REPRODUCE
1. Start a Guile REPL
2. Run the following code:
#+begin_src scheme
(use-modules (texinfo serialize))
(stexi->texi
'(*fragment* (itemize (item "mango") (item "lemon"))))
#+end_src
EXPECTED RESULT
A string like this one:
#+begin_src scheme
"@itemize\n@item\nmango\n@item\nlemon\n@end itemize\n"
#+end_src
Which displays like this:
#+begin_example
@itemize
@item
mango
@item
lemon
@end itemize
#+end_example
UNEXPECTED RESULT
A string where the "@end itemize" command is not on a line of its own.
Instead, the command gets appended to the last item in the list:
#+begin_src scheme
"\n@c %start of fragment\n\n@itemize \n@item\nmango@item\nlemon@end
itemize\n\n\n@c %end of fragment\n"
#+end_src
Which displays like this:
#+begin_example
@c %start of fragment
@itemize
@item
mango@item
lemon@end itemize
@c %end of fragment
#+end_example
Since the "@end" command is expected to be on a line of its own, tools
like Texinfo's "makeinfo" program emit warnings like the following when
converting the fragment to HTML:
#+begin_example
index.texi:73: warning: @end should only appear at the beginning of a line
#+end_example
(It seems also that the "items" themselves are not properly formatted,
and, in addition, I wouldn't expect the wrapping comments about start
and end of the fragment; but those seem like a different story, and
don't trigger warnings anyways.)
WORKAROUND
Append a newline character to the last item of the list, like so:
#+begin_src scheme
(use-modules (texinfo serialize))
(stexi->texi
'(*fragment* (itemize (item "mango") (item "lemon\n"))))
#+end_src
--
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-15 19:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-15 19:51 bug#62870: Texinfo: stexi->texi: Itemize End command not in a line of its own Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language
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).