bug-texinfo
[Top][All Lists]
Advanced

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

Re: XML output: @flushleft, @flushright, and @verb missing


From: Torsten Bronger
Subject: Re: XML output: @flushleft, @flushright, and @verb missing
Date: Wed, 30 Mar 2005 18:50:13 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Hallöchen!

Torsten Bronger <address@hidden> writes:

> In makeinfo's XML output, any contents of @flushleft, @flushright,
> and @verb macros is passed without any enclosing tags to the
> output.  Moreover, I don't see pendants of these elements in the
> DTD.

address@hidden (Karl Berry) writes:

> Thanks for the report, as always, and patches are welcome, as
> always :).

Actually I had tried to fix it for @verb.  In cmds.c, I found the
following lines in cm_verb():

  if (html)
    add_word ("<tt>");

With naive heuristics I thought "great, when this works in HTML, it
must work in XML, too".  So I changed it to:

  if (html)
    add_word ("<tt>");
  else if (xml)
    add_word ("<verb>");

However, this became "&lt;verb>foobar&lt;/verb>" in the output.
Don't both output formats follow the same lines?

Anyway, the attached patch does the job.  I don't now whether the
trick with saved_escape_html is necessary or appropriate; at least
it's used in makeinfo somewhere else, too.

Tschö,
Torsten.


===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.58
diff -c -r1.58 cmds.c
*** cmds.c      22 Mar 2005 01:29:05 -0000      1.58
--- cmds.c      30 Mar 2005 16:25:45 -0000
***************
*** 1020,1025 ****
--- 1020,1026 ----
    int character;
    int delimiter = 0; /* avoid warning */
    int seen_end = 0;
+   int saved_escape_html = escape_html;

    in_fixed_width_font++;
    /* are these necessary ? */
***************
*** 1027,1032 ****
--- 1028,1039 ----

    if (html)
      add_word ("<tt>");
+   else if (xml)
+     {
+       escape_html = 0;
+       add_word ("<verb>");
+       escape_html = saved_escape_html;
+     }

    if (input_text_offset < input_text_length)
      {
***************
*** 1087,1092 ****
--- 1094,1105 ----

    if (html)
      add_word ("</tt>");
+   else if (xml)
+     {
+       escape_html = 0;
+       add_word ("</verb>");
+       escape_html = saved_escape_html;
+     }

    in_fixed_width_font--;
  }





reply via email to

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