bug-texinfo
[Top][All Lists]
Advanced

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

@verb and @w in DocBook output


From: Gavin Smith
Subject: @verb and @w in DocBook output
Date: Fri, 13 Jan 2023 21:01:41 +0000

On Sat, Jan 07, 2023 at 09:34:29PM +0000, Gavin Smith wrote:
> On Sat, Dec 10, 2022 at 03:11:48PM +0000, Gavin Smith wrote:
> > On Sat, Dec 10, 2022 at 11:34:47AM +0000, Gavin Smith wrote:
> > > The commands were clearly based on the corresponding LaTeX commands,
> > > which we should take as authoritative.  LaTeX \verb doesn't break on
> > > a space, so Texinfo @verb shouldn't either.  I am going to revert
> > > the changes to texinfo.tex and look at using   in the HTML
> > > output.  (Sorry.)
> > 
> > I have made this change.  I have not decided what to do with line
> > breaks yet.
> 
> In the recent commit 5399b0d46913, I have made newlines inside
> the argument to @verb be output as <br> (or <br/>) for consistency with
> the TeX output.  I've also continued the recent change that multiple
> spaces inside the argument to @w do not lead to multiple non-breaking
> spaces in the output, as has always been the case for TeX output.
> 
> We should check this is consistent for the other output formats too, I
> suppose.

I've checked the important output formats (texinfo.tex, HTML, Info, DocBook,
LaTeX) and it seems that there isn't much more to be done on either @w or
@verb to get consistency across the output formats.

The main thing I found was that that not much is done with @w in DocBook
output.  The input

xx @verb{|a a  a
b|} xx

yy @w{|A A  A
B|} yy

currently outputs as

<para>xx <literal>a a  a
b</literal> xx
</para>
<para>yy |A A  A
B|<!-- /@w --> yy
</para>

Are there any thoughts on the change at the bottom of this mail?
This changes the output to:

<para>yy |A&#160;A&#160;A&#160;B|<!-- /@w --> yy
</para>

I also don't see much purpose in the /@w marker and think this could
be removed from the output.


diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 54e6445744..967dff314c 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -1013,6 +1013,8 @@ sub _convert($$;$)
           pop @{$self->{'document_context'}};
         }
         if ($element->{'cmdname'} eq 'w') {
+          $result =~ s/\n/ /g;
+          $result =~ s/ +/$nbsp/g;
           $result .= $w_command_mark;
         }
         return $result;





reply via email to

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