bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59738] mdoc: .Lk suppresses end-of-sentence recognition


From: G. Branden Robinson
Subject: [bug #59738] mdoc: .Lk suppresses end-of-sentence recognition
Date: Thu, 15 Sep 2022 13:08:16 -0400 (EDT)

Update of bug #59738 (project groff):

                  Status:               Postponed => In Progress            
             Assigned to:                    None => gbranden               
         Planned Release:                    None => 1.23.0                 

    _______________________________________________________

Follow-up Comment #3:

I understand this better now, thanks to a slightly improved grasp of this
packages Byzantine internals, and have a fix for it.

Also this was not stated in comment #0, but it affects groff 1.22.4.  Possibly
earlier versions, but perhaps not, because Ingo considerably rewrote the `Lk`
macro definition after groff 1.22.3.

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=e53dff356d43f358133138d2f99eca7b0a7fda32

Here's a reproducer, albeit not a minimal one because I'm working on verifying
several aspects of `Lk` macro behavior in an attempt to avoid regressing any
of them.


$ cat EXPERIMENTS/Lk.man 
.Dd 2022-09-15
.Dt foo 1
.Os
.Sh Name
.Nm foo
.Nd frobnicate a bar
.Pp
Click
.Lk https://www.gnu.org/software/groff/ here .
.
Or
.Lk https://gitlab.com/cjwatson/man-db here
without trailing punctuation.
.
A degenerate use of
.Li \&Lk
doesn't provide any link text.
.
.Lk https://mandoc.bsd.lv/
.
And that's all we have to say about that.
.
Except we want to end a sentence with a literal
.Li \&Lk .
.
And then see if end-of-sentence detection is lost,
affecting inter-sentence space.
.
.
.Pp
We also want to know if
.Li \&Lk
is
.Dq callable .
.
So let's
.Sy "try it" Ns No : Lk https://git.savannah.gnu.org/cgit/groff.git/ \
"on our Git repository" .
.
Here's another sentence.
$ nroff -mdoc EXPERIMENTS/Lk.man | cat -s
mdoc warning: Empty input line #34

Name
     foo — frobnicate a bar

     Click here: https://www.gnu.org/software/groff/. Or here:
     https://gitlab.com/cjwatson/man-db without trailing punctuation.  A
de‐
     generate use of Lk doesn't provide any link text. 
https://mandoc.bsd.lv/
     And that's all we have to say about that.  Except we want to end a
sen‐
     tence with a literal Lk.  And then see if end-of-sentence detection is
     lost, affecting inter-sentence space.

     We also want to know if Lk is “callable”.  So let's try it: on our
Git
     repository: https://git.savannah.gnu.org/cgit/groff.git/. Here's another
     sentence.



Here is the patch I have in progress and the output using it.


diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 8838f4c49..bc3d4ca47 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -6755,13 +6755,12 @@
 .  nop \f[\n[doc-curr-font]]\c
 .
 .  \" Format trailing arguments, like punctuation, if any.
-.  \" XXX: This loses track of end-of-sentence state.
-.  while (\n[doc-arg-ptr] <= \n[doc-arg-count]) \{\
-.    nop \&\*[doc-arg\n[doc-arg-ptr]]\c
-.    nr doc-arg-ptr +1
+.  ie (\n[doc-arg-ptr] <= \n[doc-arg-count]) \
+.    doc-print-recursive
+.  el \{\
+.    nop \&
+.    doc-reset-args
 .  \}
-.  nop \&
-.  doc-reset-args
 ..
 .ec
 .
$ ./build/test-groff -Tascii -mdoc -dAD=l -rHY=0 EXPERIMENTS/Lk.man
foo(1)                      General Commands Manual                    
foo(1)

Name
     foo -- frobnicate a bar

     Click here: https://www.gnu.org/software/groff/.  Or here:
     https://gitlab.com/cjwatson/man-db without trailing punctuation.  A
     degenerate use of Lk doesn't provide any link text.
     https://mandoc.bsd.lv/ And that's all we have to say about that.  Except
     we want to end a sentence with a literal Lk.  And then see if end-of-
     sentence detection is lost, affecting inter-sentence space.

     We also want to know if Lk is "callable".  So let's try it: on our Git
     repository: https://git.savannah.gnu.org/cgit/groff.git/.  Here's
another
     sentence.

GNU                               2022-09-15                           
foo(1)



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59738>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]