gbranden pushed a commit to branch master
in repository groff.

commit 2cfc5ddeec5d74109818cfefd7f3f29354f29545
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jun 20 12:36:16 2024 -0500

    [troff]: Fix failing test.
    
    * src/roff/troff/mtsm.cpp (mtsm::inherit): Fix failing test.
    
    I freely admit I don't completely understand why this works.  But it
    restores correct man page formatting.
    
    Complicating the problem is that grohtml/MTSM's support for centering
    and right-alignment (the `ce` and `rj` requests) never really worked
    anyway.
    
    Try this with any version of groff supporting grohtml:
    
    $ cat ATTIC/ce-rj-html.groff
    .ce 1
    This is centered.
    This is not.
    .rj 1
    This is right-aligned.
    This is aligned to the left.
    $ ~/groff-1.22.3/bin/groff -Tascii ./ATTIC/ce-rj-html.groff | cat -s
                            This is centered.
    This is not.
                                               This is right-aligned.
    This is aligned to the left.
    $ ~/groff-1.22.3/bin/groff -Thtml ./ATTIC/ce-rj-html.groff | grep '<p'
    <p align="center">This is centered. This is not.</p>
    <p>This is right-aligned. This is aligned to the left.</p>
    
    Why were these features (in grohtml/MTSM) put in if they didn't work?
---
 ChangeLog               | 4 ++++
 src/roff/troff/mtsm.cpp | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 013bd49b9..69d6d600e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-06-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/mtsm.cpp (mtsm::inherit): Fix failing test.
+
 2024-06-20  G. Branden Robinson <[email protected]>
 
        Fix Savannah #65894.  Refactor troff's "mini-troff state
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index 05ad91209..dfa41a47a 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -413,9 +413,7 @@ void mtsm::inherit(statem *s, int reset_bool)
                top.issue_no);
 #endif
     }
-    else if (s->bool_values[MTSM_BR].is_known
-            && s->bool_values[MTSM_BR].value)
-      if (! s->int_values[MTSM_CE].is_known)
+    if (! s->int_values[MTSM_CE].is_known)
        s->bool_values[MTSM_BR].unset();
     if (top.bool_values[MTSM_EOL].is_known
        && top.bool_values[MTSM_EOL].value) {

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to