discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Strings in mdoc get processed as if inlined
@ 2022-07-05 15:15 наб
  0 siblings, 0 replies; only message in thread
From: наб @ 2022-07-05 15:15 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 2746 bytes --]

Hi!

Original snippet:
-- >8 --
.Dd
.Dt DU 1
.Os
.Sh NAME
.Nm du
.Nd disk usage
.Sh OPTIONS
.Bl -tag -compact
.It Fl -time-style Ns = Ns Cm iso
Equivalent to
.ds qq \&"
.Fl -time-style Ns = Ns Cm + Ns Li "\*(qq%F\*(qq\ \ \ \ \ \ \ \ \ "
.Ar ( YYYY Ns Cm - Ns Ar MM Ns Cm - Ns Ar DD
\(em the
.St -iso8601
date format).
.It Fl -time-style Ns = Ns Cm long-iso
Equivalent to
.Fl -time-style Ns = Ns Cm + Ns Li "\*(qq%F\ %R\*(qq\ \ \ \ \ \ "
.Pq Ar YYYY Ns Cm - Ns Ar MM Ns Cm - Ns Ar DD HH Ns Cm \&: Ns Ar MM .
.It Fl -time-style Ns = Ns Cm full-iso
Equivalent to
.Fl -time-style Ns = Ns Cm + Ns Li "\*(qq%F\ %T.%N\ %z\*(qq"
.Pq Ar YYYY Ns Cm - Ns Ar MM Ns Cm - Ns Ar DD HH Ns Cm \&: Ns Ar MM Ns Cm \&: Ns Ar MM Ns Cm \&. Ns Ar NSNSNSNSN Cm \(+- Ns Ar TZTZ .
.It Fl -time-style Ns = Ns Cm + Ns Ar date-format
.El
-- >8 --

groff renders this, as expected, as 
-- >8 --
     --time-style=iso
             Equivalent to --time-style=+"%F"          (YYYY-MM-DD — the ISO 8601 date format).
     --time-style=long-iso
             Equivalent to --time-style=+"%F %R"       (YYYY-MM-DD HH:MM).
     --time-style=full-iso
             Equivalent to --time-style=+"%F %T.%N %z" (YYYY-MM-DD HH:MM:MM.NSNSNSNSN ±TZTZ).
     --time-style=+date-format
-- >8 --

mandoc trunk (as of fifteen minutes ago) renders this as
-- >8 --
     -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=i\bis\bso\bo
             Equivalent to -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=+\b+ %F"         " (_\bY_\bY_\bY_\bY-\b-_\bM_\bM-\b-_\bD_\bD — the ISO
             8601 date format).
     -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=l\blo\bon\bng\bg-\b-i\bis\bso\bo
             Equivalent to -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=+\b+ %F %R"      " (_\bY_\bY_\bY_\bY-\b-_\bM_\bM-\b-_\bD_\bD _\bH_\bH:\b:_\bM_\bM).
     -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=f\bfu\bul\bll\bl-\b-i\bis\bso\bo
             Equivalent to -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=+\b+ %F %T.%N %z"" (_\bY_\bY_\bY_\bY-\b-_\bM_\bM-\b-_\bD_\bD
             _\bH_\bH:\b:_\bM_\bM:\b:_\bM_\bM.\b._\bN_\bS_\bN_\bS_\bN_\bS_\bN_\bS_\bN ±\b±_\bT_\bZ_\bT_\bZ).
     -\b--\b-t\bti\bim\bme\be-\b-s\bst\bty\byl\ble\be=+\b+_\bd_\ba_\bt_\be_\b-_\bf_\bo_\br_\bm_\ba_\bt
-- >8 --


Simplified:
-- >8 --
.ds qq \&"
.Sy "\*(qq a \*(qq b"
-- >8 --

groff renders this as:
-- >8 --
     " a " b
-- >8 --
(single argument containing " a " b)

but mandoc trunk as:
-- >8 --
      a\ba "\b" b\bb"\b"
-- >8 --


Inlining the string as
-- >8 --
.Sy "\&" a \&" b"
-- >8 --
(three arguments, one with just \&, the second a, the third " b")
makes groff output the same thing as mandoc.


This is non-critical for me, since I was just trying to come up with a
less annoying spelling for this, but it's nevertheless a groff
incompatibility.

Best,
наб

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-05 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 15:15 Strings in mdoc get processed as if inlined наб

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 NNTP newsgroup(s).