AOSC-Archive / metahtml

git mirror for a programming language specifically designed for working within the World Wide Web environment
Other
1 stars 1 forks source link

XHTML bug: <div> always uppercase. #1

Open Artoria2e5 opened 8 years ago

Artoria2e5 commented 8 years ago

Imported from: http://sourceforge.net/p/metahtml/bugs/1/ By: Andrea Bocci (fwyzard)

Working on converting the GCC website from HTML to XHTML, I've found out that Meta--HTML always translates a <div> tag as <DIV > (note the uppercase and trailing whitespace), thus making it impossible to obtain full XHTML compliance (wich requires lowercase tags). I've seen this behaviour is present in both Meta-HTML 5.091 and 6.11.01.

Investigating a bit, I've found the "guilty" piece of code in libmhtml/mathfuncs.c:

--- metahtml-5.091/libmhtml/mathfuncs.c Mon Apr 12 10:40:24 1999
+++ mathfuncs.c Sat Jan 26 18:00:12 2002
@@ -808,7 +808,10 @@ Examples:
      not us. */
   if (get_positional_arg (vars, 0) == (char *)NULL)
     {
-      bprintf_insert (page, start, "<DIV %s>", mhtml_funargs (vars));
+      if (mhtml_funargs (vars) == (char *)NULL)
+        bprintf_insert (page, start, "<div>");
+      else
+        bprintf_insert (page, start, "<div %s>", mhtml_funargs (vars));
       *newstart += 4;
     }
   else

I've tried it and it works for the GCC web site, but don't know if it skrews up the <div> internal. Anyway, I'm attaching a patch to fix it as proposed...