discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: discuss@mandoc.bsd.lv
Subject: Strings in mdoc get processed as if inlined
Date: Tue, 5 Jul 2022 17:15:36 +0200	[thread overview]
Message-ID: <20220705151536.tqmlsw4z4pqraue6@tarta.nabijaczleweli.xyz> (raw)

[-- 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 --]

                 reply	other threads:[~2022-07-05 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705151536.tqmlsw4z4pqraue6@tarta.nabijaczleweli.xyz \
    --to=nabijaczleweli@nabijaczleweli.xyz \
    --cc=discuss@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).