gbranden pushed a commit to branch master
in repository groff.

commit 2b1ac62922d9fca8662d81663b00629243764a16
Author: Nguyễn Gia Phong <[email protected]>
AuthorDate: Wed Jul 8 11:14:03 2026 +0900

    [eqn]: Emit better-formed XHTML/MathML. (1/3)
    
    * src/preproc/eqn/box.cpp
      (half_space_box::output)
      (full_space_box::output)
      (thick_space_box::output)
      (thin_space_box::output):
    * src/preproc/eqn/other.cpp
      (overline_char_box::output)
      (overline_box::output)
      (underline_char_box::output)
      (underline_box::output): Emit numeric character references, not named
      entities, when generating MathML, because GNU eqn supports MathML only
      when producing XHTML.
    
    Begins fixing <https://savannah.gnu.org/bugs/?68499>.
---
 ChangeLog                 | 17 +++++++++++++++++
 src/preproc/eqn/box.cpp   |  8 ++++----
 src/preproc/eqn/other.cpp |  8 ++++----
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5b860735b..a0b3a0319 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2026-07-08  Nguyễn Gia Phong <[email protected]>
+
+       * src/preproc/eqn/box.cpp
+       (half_space_box::output)
+       (full_space_box::output)
+       (thick_space_box::output)
+       (thin_space_box::output):
+       * src/preproc/eqn/other.cpp
+       (overline_char_box::output)
+       (overline_box::output)
+       (underline_char_box::output)
+       (underline_box::output): Emit numeric character references, not
+       named entities, when generating MathML, because GNU eqn supports
+       MathML only when producing XHTML.
+
+       Begins fixing <https://savannah.gnu.org/bugs/?68499>.
+
 2026-07-13  G. Branden Robinson <[email protected]>
 
        * src/devices/grohtml/post-html.cpp (get_html_entity): Emit
diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp
index 76b1a6e04..95a6139ee 100644
--- a/src/preproc/eqn/box.cpp
+++ b/src/preproc/eqn/box.cpp
@@ -654,7 +654,7 @@ void half_space_box::output()
   if (output_format == troff)
     printf("\\h'%dM'", half_space);
   else if (output_format == mathml)
-    printf("<mtext>&ThinSpace;</mtext>");
+    printf("<mtext>&#x2009;</mtext>");
   else
     assert("unimplemented output format");
 }
@@ -669,7 +669,7 @@ void full_space_box::output()
   if (output_format == troff)
     printf("\\h'%dM'", full_space);
   else if (output_format == mathml)
-    printf("<mtext>&ThickSpace;</mtext>");
+    printf("<mtext>&#x205F;&#x200A;</mtext>");
   else
     assert("unimplemented output format");
 }
@@ -684,7 +684,7 @@ void thick_space_box::output()
   if (output_format == troff)
     printf("\\h'%dM'", thick_space);
   else if (output_format == mathml)
-    printf("<mtext>&ThickSpace;</mtext>");
+    printf("<mtext>&#x205F;&#x200A;</mtext>");
   else
     assert("unimplemented output format");
 }
@@ -699,7 +699,7 @@ void thin_space_box::output()
   if (output_format == troff)
     printf("\\h'%dM'", thin_space);
   else if (output_format == mathml)
-    printf("<mtext>&ThinSpace;</mtext>");
+    printf("<mtext>&#x2009;</mtext>");
   else
     assert("unimplemented output format");
 }
diff --git a/src/preproc/eqn/other.cpp b/src/preproc/eqn/other.cpp
index 9781b7b92..72c5be63f 100644
--- a/src/preproc/eqn/other.cpp
+++ b/src/preproc/eqn/other.cpp
@@ -184,7 +184,7 @@ void overline_char_box::output()
           get_param("x_height"));
   }
   else if (output_format == mathml)
-    printf("<mo>&macr;</mo>");
+    printf("<mo>&#x00AF;</mo>");
 }
 
 void overline_char_box::debug_print()
@@ -240,7 +240,7 @@ void overline_box::output()
   else if (output_format == mathml) {
     printf("<mover accent='false'>");
     p->output();
-    printf("<mo>&macr;</mo></mover>");
+    printf("<mo>&#x00AF;</mo></mover>");
   }
 }
 
@@ -364,7 +364,7 @@ void underline_char_box::output()
     printf("\\v'-%dM/2u'", 7 * get_param("default_rule_thickness"));
   }
   else if (output_format == mathml)
-    printf("<mo>&lowbar;</mo>");
+    printf("<mo>_</mo>");
 }
 
 void underline_char_box::debug_print()
@@ -422,7 +422,7 @@ void underline_box::output()
   else if (output_format == mathml) {
     printf("<munder accent='true'>");
     p->output();
-    printf("<mo>&macr;</mo></munder>");
+    printf("<mo>&#x00AF;</mo></munder>");
   }
 }
 

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

Reply via email to