bug-texinfo
[Top][All Lists]
Advanced

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

Re: @verb and @w in DocBook output


From: Patrice Dumas
Subject: Re: @verb and @w in DocBook output
Date: Fri, 13 Jan 2023 23:10:31 +0100

On Fri, Jan 13, 2023 at 09:01:41PM +0000, Gavin Smith wrote:
> 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?

Looks good to me.

> 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.

If I recall well, the idea was that even an empty @w{} would lead to
some output such that if within a string, the string would not end eup
contiguous in XML based outputs.  For example to avoid $Id$ keywords
expansion that are expanded in CVS, using $I@w{}d$ would make sure that
in the HTML output $Id$ is expanded to a string that is not considered
special, as $I is separated from d$.

> 
> 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]