Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--quote-ampersand yes doesn't work #876

Closed
jidanni opened this issue Apr 25, 2020 · 7 comments
Closed

--quote-ampersand yes doesn't work #876

jidanni opened this issue Apr 25, 2020 · 7 comments
Labels

Comments

@jidanni
Copy link
Contributor

jidanni commented Apr 25, 2020

$ echo '&'    |tidy --show-body-only yes -q --quote-ampersand yes --preserve-entities yes
& #Hey, the man page said it would convert this to & !
$ echo '&'|tidy --show-body-only yes -q --quote-ampersand yes --preserve-entities yes
& #Well, at least it didn't destroy it, like the following:
$ echo '&'|tidy --show-body-only yes -q --quote-ampersand yes
&
$ echo '&'|tidy --show-body-only yes -q
&

HTML Tidy for Linux version 5.6.0

@ler762
Copy link
Contributor

ler762 commented Apr 30, 2020 via email

@jidanni
Copy link
Contributor Author

jidanni commented May 1, 2020

Well all I know is

  • I want to use HTML5
  • I want my naked isolated &s to be left alone, and not be converted back to plain &s,
    even if they are now allowed.

But does the spec say isolated, naked &s are no longer allowed?

@ler762
Copy link
Contributor

ler762 commented May 1, 2020 via email

@jidanni
Copy link
Contributor Author

jidanni commented May 1, 2020

Oh yeah, I forgot. I also want my raw naked &s to become &s too!

@ler762
Copy link
Contributor

ler762 commented May 1, 2020 via email

@geoffmcl
Copy link
Contributor

@jidanni, @ler762 thanks for raising this ampersand issue again...

In addition to #207, see open #861, and maybe others...

$ echo '&' |tidy --show-body-only yes -q --quote-ampersand yes --preserve-entities yes
& #Hey, the man page said it would convert this to & !

The man page is only partially right...

Below is a patch to fix this, and #892 -

diff --git a/src/language_en.h b/src/language_en.h
index 60bde02..8d0eb7a 100644
--- a/src/language_en.h
+++ b/src/language_en.h
@@ -1117,7 +1117,7 @@ static languageDefinition language_en = { whichPluralForm_en, {
       be translated. */
         TidyQuoteAmpersand,           0,
         "This option specifies if Tidy should output unadorned <code>&amp;</code> "
-        "characters as <code>&amp;amp;</code>. "
+        "characters as <code>&amp;amp;</code>, in legacy doctypes only. "
     },
     {/* Important notes for translators:
       - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@@ -2337,7 +2337,7 @@ static languageDefinition language_en = { whichPluralForm_en, {
         " of \"--some-option <value>\", for example, \"--indent-with-tabs yes\".\n"
         "\n"
         " You can also specify a file containing configuration options with the \n"
-        " -options <file> directive, or in one or more files specific to your \n"
+        " -config <file> directive, or in one or more files specific to your \n"
         " environment (see next section). \n"
         "\n"
         " For a list of all configuration options, use \"-help-config\" or refer\n"

As prepared for issue #807, I think if you use a legacy doctype, like in my in_207-5.html, and you should note the different output using --quote-ampersand no, as @ler762 pointed out...

And maybe the preserve-entities docs could likewise be improved... or not...

Please apply the patch, and test with both legacy and html5 doctypes, and advise...

If merged, would this close this issue?

Feedback, discussion, samples, other patches, PR, welcome... thanks...

@geoffmcl
Copy link
Contributor

Docs change for the --quote-ampersand - see commit e10f647

Is there anything else outstanding here? seems this can be closed...

Please feel free to re-open, or file a new issue... thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants