texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/init/html32.pm: do not use − , protect


From: Patrice Dumas
Subject: branch master updated: * tp/init/html32.pm: do not use − , protect with html32_format_protect_text to avoid " .
Date: Thu, 13 Oct 2022 16:19:54 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new c73987c25b * tp/init/html32.pm: do not use −, protect with 
html32_format_protect_text to avoid ".
c73987c25b is described below

commit c73987c25b06ab849fc56d543ba2146ba5311b17
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Oct 13 22:19:43 2022 +0200

    * tp/init/html32.pm: do not use &minus;, protect with
    html32_format_protect_text to avoid &quot;.
---
 ChangeLog                                          |  5 ++
 tp/init/html32.pm                                  | 38 +++++-----
 .../res_parser/formatting_html32/formatting.html   | 80 +++++++++++-----------
 3 files changed, 64 insertions(+), 59 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd55aec5eb..d47607be33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/init/html32.pm: do not use &minus;, protect with
+       html32_format_protect_text to avoid &quot;.
+
 2022-10-13  Patrice Dumas  <pertusus@free.fr>
 
        Use &minus; for @minus{} in HTML output
diff --git a/tp/init/html32.pm b/tp/init/html32.pm
index 48ce142dcd..d50144a2c7 100644
--- a/tp/init/html32.pm
+++ b/tp/init/html32.pm
@@ -38,7 +38,6 @@ use strict;
 
 use Texinfo::Common;
 
-use Texinfo::Convert::Converter qw(xml_protect_text);
 use Texinfo::Convert::Text;
 
 
@@ -71,14 +70,30 @@ texinfo_set_from_init_file('MENU_SYMBOL', '*');
 texinfo_set_from_init_file('OPEN_QUOTE_SYMBOL', '`');
 texinfo_set_from_init_file('CLOSE_QUOTE_SYMBOL', "'");
 
+
+# &quot; is not in html 3.2
+sub html32_format_protect_text($$)
+{
+  my $converter = shift;
+  my $text = shift;
+  $text =~ s/&/&amp;/g;
+  $text =~ s/</&lt;/g;
+  $text =~ s/>/&gt;/g;
+  $text =~ s/\"/&#34;/g;
+  $text =~ s/\f/&#12;/g;
+  return $text;
+}
+
+texinfo_register_formatting_function('format_protect_text', 
\&html32_format_protect_text);
+
+
 foreach my $command ('euro', 'geq', 'leq',
-   'bullet', 'equiv', 'expansion', 'point', 'result', 'arrow',
+   'bullet', 'equiv', 'expansion', 'minus', 'point', 'result', 'arrow',
    'quotedblleft', 'quotedblright',
    'quoteleft', 'quoteright',
    'quotedblbase', 'quotesinglbase', 'guillemetleft', 'guillemetright',
    'guillemotleft', 'guillemotright', 'guilsinglleft', 'guilsinglright') {
-  
-  my $formatted_command = xml_protect_text(undef,
+  my $formatted_command = html32_format_protect_text(undef,
              $Texinfo::Convert::Text::text_brace_no_arg_commands{$command});
   texinfo_register_no_arg_command_formatting($command, undef, 
$formatted_command);
 }
@@ -112,21 +127,6 @@ sub html32_setup($)
 }
 
 
-# &quot; is not in html 3.2
-sub html32_format_protect_text($$)
-{
-  my $converter = shift;
-  my $text = shift;
-  $text =~ s/&/&amp;/g;
-  $text =~ s/</&lt;/g;
-  $text =~ s/>/&gt;/g;
-  $text =~ s/\"/&#34;/g;
-  $text =~ s/\f/&#12;/g;
-  return $text;
-}
-
-texinfo_register_formatting_function('format_protect_text', 
\&html32_format_protect_text);
-
 sub html32_format_separate_anchor($$;$)
 {
   my $self = shift;
diff --git a/tp/tests/layout/res_parser/formatting_html32/formatting.html 
b/tp/tests/layout/res_parser/formatting_html32/formatting.html
index 952301184c..98e44f562b 100644
--- a/tp/tests/layout/res_parser/formatting_html32/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_html32/formatting.html
@@ -926,7 +926,7 @@ but , ,
 @equiv ==
 @error error-&gt;
 @expansion ==&gt;
-@minus &minus;
+@minus -
 @point -!-
 @print -|
 @result =&gt;
@@ -955,8 +955,8 @@ but , ,
 @ordf &ordf;
 @ordm &ordm;
 @comma ,
-@quotedblleft &quot;
-@quotedblright &quot;
+@quotedblleft &#34;
+@quotedblright &#34;
 @quoteleft `
 @quoteright '
 @quotedblbase ,,
@@ -995,7 +995,7 @@ but , ,
 <code>@i{--a}</code> <i>-a</i>
 <code>@kbd{--a}</code> <kbd>--a</kbd>
 <code>@key{--a}</code> <kbd>--a</kbd>
-<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} 
&minus;</em>
+<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} -</em>
 <code>@option{--a}</code> <samp>--a</samp>
 <code>@r{--a}</code> -a
 <code>@samp{--a}</code> `<samp>--a</samp>'
@@ -1073,12 +1073,12 @@ a sunny day
 <div><em>-&gt;
 &#x0075;
 * &copy; ... ... ==
-error-&gt; ==&gt; &minus; -| =&gt;
+error-&gt; ==&gt; - -| =&gt;
 &Aring; &aelig; &#156; &AElig; &#140; &oslash; &Oslash; &szlig; &#322; &#321; 
&ETH;
 &THORN; &eth; &thorn; &iexcl; &iquest; &pound;
 &ordf; &ordm; , 
 </em></div>
-<div><em>&quot; &quot; 
+<div><em>&#34; &#34; 
 ` ' ,, , &lt;&lt;
 &gt;&gt; &lt;&lt; &gt;&gt; &lt;
 &gt; Euro -&gt; &lt;= &gt;=
@@ -1237,7 +1237,7 @@ error-&gt; ==&gt; &minus; -| =&gt;
 </li></ul>
 
 <ul>
-<li>&minus; minu-s
+<li>- minu-s
 </li></ul>
 
 <ul>
@@ -1742,7 +1742,7 @@ html ''
 <code>@abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} }</code> 
&Eacute;-. ,A. (&Eacute;tude-, <b>Autonome</b>)
 <code>@abbr{@'E--. @comma{}A.}</code> &Eacute;-. ,A.
 </p>
-<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a&minus; 
{\frac{1}{2}}</em>
+<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a- {\frac{1}{2}}</em>
 </p>
 
 
@@ -1977,7 +1977,7 @@ but , ,
 @equiv ==
 @error error-&gt;
 @expansion ==&gt;
-@minus &minus;
+@minus -
 @point -!-
 @print -|
 @result =&gt;
@@ -2006,8 +2006,8 @@ but , ,
 @ordf &ordf;
 @ordm &ordm;
 @comma ,
-@quotedblleft &quot;
-@quotedblright &quot;
+@quotedblleft &#34;
+@quotedblright &#34;
 @quoteleft `
 @quoteright '
 @quotedblbase ,,
@@ -2046,7 +2046,7 @@ but , ,
 <code>@i{--a}</code> <i>-a</i>
 <code>@kbd{--a}</code> <kbd>--a</kbd>
 <code>@key{--a}</code> <kbd>--a</kbd>
-<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} 
&minus;</em>
+<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} -</em>
 <code>@option{--a}</code> <samp>--a</samp>
 <code>@r{--a}</code> -a
 <code>@samp{--a}</code> `<samp>--a</samp>'
@@ -2124,12 +2124,12 @@ a sunny day
 <div><em>-&gt;
 &#x0075;
 * &copy; ... ... ==
-error-&gt; ==&gt; &minus; -| =&gt;
+error-&gt; ==&gt; - -| =&gt;
 &Aring; &aelig; &#156; &AElig; &#140; &oslash; &Oslash; &szlig; &#322; &#321; 
&ETH;
 &THORN; &eth; &thorn; &iexcl; &iquest; &pound;
 &ordf; &ordm; , 
 </em></div>
-<div><em>&quot; &quot; 
+<div><em>&#34; &#34; 
 ` ' ,, , &lt;&lt;
 &gt;&gt; &lt;&lt; &gt;&gt; &lt;
 &gt; Euro -&gt; &lt;= &gt;=
@@ -2288,7 +2288,7 @@ error-&gt; ==&gt; &minus; -| =&gt;
 </li></ul>
 
 <ul>
-<li>&minus; minu-s
+<li>- minu-s
 </li></ul>
 
 <ul>
@@ -2793,7 +2793,7 @@ html ''
 <code>@abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} }</code> 
&Eacute;-. ,A. (&Eacute;tude-, <b>Autonome</b>)
 <code>@abbr{@'E--. @comma{}A.}</code> &Eacute;-. ,A.
 </p>
-<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a&minus; 
{\frac{1}{2}}</em>
+<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a- {\frac{1}{2}}</em>
 </p>
 
 
@@ -3084,7 +3084,7 @@ but , ,
 @equiv ==
 @error error-&gt;
 @expansion ==&gt;
-@minus &minus;
+@minus -
 @point -!-
 @print -|
 @result =&gt;
@@ -3113,8 +3113,8 @@ but , ,
 @ordf &ordf;
 @ordm &ordm;
 @comma ,
-@quotedblleft &quot;
-@quotedblright &quot;
+@quotedblleft &#34;
+@quotedblright &#34;
 @quoteleft `
 @quoteright '
 @quotedblbase ,,
@@ -3153,7 +3153,7 @@ but , ,
 <code>@i{--a}</code> <i>-a</i>
 <code>@kbd{--a}</code> <kbd>--a</kbd>
 <code>@key{--a}</code> <kbd>--a</kbd>
-<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} 
&minus;</em>
+<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} -</em>
 <code>@option{--a}</code> <samp>--a</samp>
 <code>@r{--a}</code> -a
 <code>@samp{--a}</code> `<samp>--a</samp>'
@@ -3231,12 +3231,12 @@ a sunny day
 <div><em>-&gt;
 &#x0075;
 * &copy; ... ... ==
-error-&gt; ==&gt; &minus; -| =&gt;
+error-&gt; ==&gt; - -| =&gt;
 &Aring; &aelig; &#156; &AElig; &#140; &oslash; &Oslash; &szlig; &#322; &#321; 
&ETH;
 &THORN; &eth; &thorn; &iexcl; &iquest; &pound;
 &ordf; &ordm; , 
 </em></div>
-<div><em>&quot; &quot; 
+<div><em>&#34; &#34; 
 ` ' ,, , &lt;&lt;
 &gt;&gt; &lt;&lt; &gt;&gt; &lt;
 &gt; Euro -&gt; &lt;= &gt;=
@@ -3395,7 +3395,7 @@ error-&gt; ==&gt; &minus; -| =&gt;
 </li></ul>
 
 <ul>
-<li>&minus; minu-s
+<li>- minu-s
 </li></ul>
 
 <ul>
@@ -3900,7 +3900,7 @@ html ''
 <code>@abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} }</code> 
&Eacute;-. ,A. (&Eacute;tude-, <b>Autonome</b>)
 <code>@abbr{@'E--. @comma{}A.}</code> &Eacute;-. ,A.
 </p>
-<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a&minus; 
{\frac{1}{2}}</em>
+<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a- {\frac{1}{2}}</em>
 </p>
 
 
@@ -4133,7 +4133,7 @@ but , ,
 @equiv ==
 @error error-&gt;
 @expansion ==&gt;
-@minus &minus;
+@minus -
 @point -!-
 @print -|
 @result =&gt;
@@ -4162,8 +4162,8 @@ but , ,
 @ordf &ordf;
 @ordm &ordm;
 @comma ,
-@quotedblleft &quot;
-@quotedblright &quot;
+@quotedblleft &#34;
+@quotedblright &#34;
 @quoteleft `
 @quoteright '
 @quotedblbase ,,
@@ -4202,7 +4202,7 @@ but , ,
 <code>@i{--a}</code> <i>-a</i>
 <code>@kbd{--a}</code> <kbd>--a</kbd>
 <code>@key{--a}</code> <kbd>--a</kbd>
-<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} 
&minus;</em>
+<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} -</em>
 <code>@option{--a}</code> <samp>--a</samp>
 <code>@r{--a}</code> -a
 <code>@samp{--a}</code> `<samp>--a</samp>'
@@ -4280,12 +4280,12 @@ a sunny day
 <div><em>-&gt;
 &#x0075;
 * &copy; ... ... ==
-error-&gt; ==&gt; &minus; -| =&gt;
+error-&gt; ==&gt; - -| =&gt;
 &Aring; &aelig; &#156; &AElig; &#140; &oslash; &Oslash; &szlig; &#322; &#321; 
&ETH;
 &THORN; &eth; &thorn; &iexcl; &iquest; &pound;
 &ordf; &ordm; , 
 </em></div>
-<div><em>&quot; &quot; 
+<div><em>&#34; &#34; 
 ` ' ,, , &lt;&lt;
 &gt;&gt; &lt;&lt; &gt;&gt; &lt;
 &gt; Euro -&gt; &lt;= &gt;=
@@ -4444,7 +4444,7 @@ error-&gt; ==&gt; &minus; -| =&gt;
 </li></ul>
 
 <ul>
-<li>&minus; minu-s
+<li>- minu-s
 </li></ul>
 
 <ul>
@@ -4949,7 +4949,7 @@ html ''
 <code>@abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} }</code> 
&Eacute;-. ,A. (&Eacute;tude-, <b>Autonome</b>)
 <code>@abbr{@'E--. @comma{}A.}</code> &Eacute;-. ,A.
 </p>
-<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a&minus; 
{\frac{1}{2}}</em>
+<p><code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a- {\frac{1}{2}}</em>
 </p>
 
 
@@ -5187,7 +5187,7 @@ but , ,
 @equiv ==
 @error error-&gt;
 @expansion ==&gt;
-@minus &minus;
+@minus -
 @point -!-
 @print -|
 @result =&gt;
@@ -5216,8 +5216,8 @@ but , ,
 @ordf &ordf;
 @ordm &ordm;
 @comma ,
-@quotedblleft &quot;
-@quotedblright &quot;
+@quotedblleft &#34;
+@quotedblright &#34;
 @quoteleft `
 @quoteright '
 @quotedblbase ,,
@@ -5256,7 +5256,7 @@ but , ,
 <code>@i{--a}</code> <i>--a</i>
 <code>@kbd{--a}</code> <kbd>--a</kbd>
 <code>@key{--a}</code> <kbd>--a</kbd>
-<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} 
&minus;</em>
+<code>@math{--a {\frac{1}{2}} @minus{}}</code> <em>--a {\frac{1}{2}} -</em>
 <code>@option{--a}</code> <samp>--a</samp>
 <code>@r{--a}</code> -a
 <code>@samp{--a}</code> `<samp>--a</samp>'
@@ -5342,13 +5342,13 @@ a sunny day
 </pre><div><em>-&gt;
 &#x0075;
 * &copy; ... ... ==
-error-&gt; ==&gt; &minus; -| =&gt;
+error-&gt; ==&gt; - -| =&gt;
 &Aring; &aelig; &#156; &AElig; &#140; &oslash; &Oslash; &szlig; &#322; &#321; 
&ETH;
 &THORN; &eth; &thorn; &iexcl; &iquest; &pound;
 &ordf; &ordm; , 
 </em></div><pre>
 
-</pre><div><em>&quot; &quot; 
+</pre><div><em>&#34; &#34; 
 ` ' ,, , &lt;&lt;
 &gt;&gt; &lt;&lt; &gt;&gt; &lt;
 &gt; Euro -&gt; &lt;= &gt;=
@@ -5541,7 +5541,7 @@ error-&gt; ==&gt; &minus; -| =&gt;
 <pre>
 
 </pre><ul>
-<li>&minus; <pre>minu--s
+<li>- <pre>minu--s
 </pre></li></ul>
 <pre>
 
@@ -6135,7 +6135,7 @@ html ''
 <code>@abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} }</code> 
&Eacute;--. ,A. (&Eacute;tude--, <b>Autonome</b>)
 <code>@abbr{@'E--. @comma{}A.}</code> &Eacute;--. ,A.
 
-<code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a&minus; {\frac{1}{2}}</em>
+<code>@math{--a@minus{} {\frac{1}{2}}}</code> <em>--a- {\frac{1}{2}}</em>
 
 
 



reply via email to

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