You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the adoc document that uses nested quotations, e.g. asciidoctor `fails _to_ generate\` correct manpage in case of nested quotations.
If we convert it to manpage using asciidoctor -o "t.1" -b "manpage" "t.adoc"
command then the following markup is generated: asciidoctor \f(CRfails \fIto\fP generate\fP correct manpage in case of nested quotations..
This manpage renders quite strange with man command:
This is due to second \fP directive cancels previous \fP directive, not \f(CR.
The right manpage markup should probably look like: asciidoctor \f(CRfails \fP\fIto\fP\f(CR generate\fP correct manpage in case of nested quotations.
so this code should track quotations hierarchy by itself.
The manpage converter is not a perfect solution. It's designed to be good enough. It handles common markup, but may mess up markup is combined.
If you know what the solution is, you're welcome to send a PR to propose a fix. It's not something I have time to work on, nor do I understand how this is supposed to be supported in the groff syntax.
The manpage converter is not a perfect solution. It's designed to be good enough. It handles common markup, but may mess up markup is combined.
If you know what the solution is, you're welcome to send a PR to propose a fix. It's not something I have time to work on, nor do I understand how this is supposed to be supported in the groff syntax.
roff formatters do not maintain a stack of font selections. Instead they maintain only a notion of the "current" font selection and the "previous" one. When you select a new font, the the current becomes the previous and the selection becomes current. When you restore the previous font, the previous and current swap.
That's all there is to it. It is simple because that is what was tractable on a PDP-11 with an address space on the order of 16 bits. roff and Unix have a shared origin story.
Macro languages can enable arbitrarily deep nesting of all sorts of things, but (A) the man package doesn't offer such a feature for font selections and (B) programs that generateman documents tend to eschew use of font selection macros in favor of font selection escape sequences (\f) because doing the latter tends to avoid the necessity of scanning ahead in the input.
Consider the adoc document that uses nested quotations, e.g.
asciidoctor `fails _to_ generate\` correct manpage in case of nested quotations.
If we convert it to manpage using
asciidoctor -o "t.1" -b "manpage" "t.adoc"
command then the following markup is generated:
asciidoctor \f(CRfails \fIto\fP generate\fP correct manpage in case of nested quotations.
.This manpage renders quite strange with
man
command:This is due to second
\fP
directive cancels previous\fP
directive, not\f(CR
.The right manpage markup should probably look like:
asciidoctor \f(CRfails \fP\fIto\fP\f(CR generate\fP correct manpage in case of nested quotations.
so this code should track quotations hierarchy by itself.
This issue was spotted in the wild by freebsd people (however it is not freebsd-specific) in ccache manual page ( adoc source, asciidoctor invocation ).
Reproduces with
Asciidoctor 2.0.18
,ruby 3.1.3
The text was updated successfully, but these errors were encountered: