Merge branch 'next' into issue-456

Manually fixed merge commits.
This commit is contained in:
Jim Derry 2017-08-28 15:17:10 -04:00
commit 1562c42c2e
21 changed files with 566 additions and 149 deletions

View File

@ -1,4 +1,6 @@
@setlocal
@REM 20170702 - Check branch
@set TMPBR=next
@REM 20161002 - Change to msvc140 build
@set VCVERS=14
@set GENERATOR=Visual Studio %VCVERS% Win64
@ -62,6 +64,9 @@
:GOTCMD
@call chkmsvc %TMPPRJ%
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto BADBR
:GOTBR
@echo Begin %DATE% %TIME%, output to %TMPLOG%
@echo Begin %DATE% %TIME% >> %TMPLOG%
@ -176,6 +181,16 @@
@if ERRORLEVEL 1 goto ERR33
@goto DNREL
:BADBR
@call git checkout %TMPBR%
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto BADBR2
@goto GOTBR
:BADBR2
@call shwbranch
@echo Not on correct branch %TMPBR%
@goto ISERR
:ISERR
@endlocal
@exit /b 1

View File

@ -548,6 +548,8 @@ TIDY_EXPORT int TIDY_CALL tidySetOutCharEncoding(TidyDoc tdoc, /**< The
/** This typedef represents the required signature for your provided callback
** function should you wish to register one with tidySetOptionCallback().
** Your callback function will be provided with the following parameters.
** Note that this is deprecated and you should instead migrate to
** tidySetConfigCallback().
** @param option The option name that was provided.
** @param value The option value that was provided
** @return Your callback function will return `yes` if it handles the provided
@ -560,12 +562,38 @@ typedef Bool (TIDY_CALL *TidyOptCallback)(ctmbstr option, ctmbstr value);
** configuration file options. Setting this callback allows a LibTidy
** application developer to examine command-line and configuration file options
** after LibTidy has examined them and failed to recognize them.
** Note that this is deprecated and you should instead migrate to
** tidySetConfigCallback().
** @result Returns `yes` upon success.
*/
TIDY_EXPORT Bool TIDY_CALL tidySetOptionCallback(TidyDoc tdoc, /**< The document to apply the callback to. */
TidyOptCallback pOptCallback /**< The name of a function of type TidyOptCallback() to serve as your callback. */
);
/** This typedef represents the required signature for your provided callback
** function should you wish to register one with tidySetOptionCallback().
** Your callback function will be provided with the following parameters.
** @param tdoc The document instance for which the callback was invoked.
** @param option The option name that was provided.
** @param value The option value that was provided
** @return Your callback function will return `yes` if it handles the provided
** option, or `no` if it does not. In the latter case, Tidy will issue
** an unknown configuration option error.
*/
typedef Bool (TIDY_CALL *TidyConfigCallback)(TidyDoc tdoc, ctmbstr option, ctmbstr value);
/** Applications using TidyLib may want to augment command-line and
** configuration file options. Setting this callback allows a LibTidy
** application developer to examine command-line and configuration file options
** after LibTidy has examined them and failed to recognize them.
** Note that this is deprecated and you should instead migrate to
** tidySetConfigCallback().
** @result Returns `yes` upon success.
*/
TIDY_EXPORT Bool TIDY_CALL tidySetConfigCallback(TidyDoc tdoc, /**< The document to apply the callback to. */
TidyConfigCallback pConfigCallback /**< The name of a function of type TidyConfigCallback() to serve as your callback. */
);
/** @}
** @name Option ID Discovery
** @{

View File

@ -268,12 +268,14 @@ extern "C" {
FN(REMOVED_HTML5) \
FN(XML_DECLARATION_DETECTED) \
/* Report, mixed use */ \
FN(ADDED_MISSING_CHARSET) \
FN(COERCE_TO_ENDTAG) \
FN(ELEMENT_NOT_EMPTY) \
FN(FOUND_STYLE_IN_BODY) \
FN(MOVED_STYLE_TO_HEAD) \
FN(UNEXPECTED_END_OF_FILE) \
FN(UNEXPECTED_ENDTAG) \
FN(ADDED_MISSING_CHARSET)
FN(UNEXPECTED_ENDTAG)
/** These are report messages added by Tidy's accessibility module. */
#define FOREACH_ACCESS_MSG(FN) \
@ -594,6 +596,7 @@ typedef enum
TidyMergeDivs, /**< Merge multiple DIVs */
TidyMergeEmphasis, /**< Merge nested B and I elements */
TidyMergeSpans, /**< Merge multiple SPANs */
TidyMetaCharset, /**< Adds/checks/fixes meta charset in the head, based on document type */
#if SUPPORT_ASIAN_ENCODINGS
TidyNCR, /**< Allow numeric character references */
#else
@ -625,10 +628,12 @@ typedef enum
TidyShowErrors, /**< Number of errors to put out */
TidyShowInfo, /**< If true, info-level messages are shown */
TidyShowMarkup, /**< If false, normal output is suppressed */
TidyShowMetaChange, /**< show when meta http-equiv content charset was changed - compatibility */
TidyShowWarnings, /**< However errors are always shown */
TidySkipNested, /**< Skip nested tags in script and style CDATA */
TidySortAttributes, /**< Sort attributes */
TidyStrictTagsAttr, /**< Ensure tags and attributes match output HTML version */
TidyStyleTags, /**< Move sytle to head */
TidyTabSize, /**< Expand tabs to n spaces */
TidyUpperCaseAttrs, /**< Output attributes in upper not lower case */
TidyUpperCaseTags, /**< Output tags in upper not lower case */
@ -650,8 +655,6 @@ typedef enum
TidyXmlPIs, /**< If set to yes PIs must end with ?> */
TidyXmlSpace, /**< If set to yes adds xml:space attr as needed */
TidyXmlTags, /**< Treat input as XML */
TidyMetaCharset, /**< Adds/checks/fixes meta charset in the head, based on document type */
TidyShowMetaChange, /**< show when meta http-equiv content charset was changed - compatibility */
N_TIDY_OPTIONS /**< Must be last */
} TidyOptionId;

View File

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-05-13 21:04:45\n"
"PO-Revision-Date: 2017-08-28 10:04:30\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -85,6 +85,12 @@ msgid ""
"<code>&amp;emdash;</code>, <code>&amp;rdquo;</code>, and other named "
"character entities are downgraded to their closest ASCII equivalents. "
msgstr ""
"Can be used to modify behaviour of the <code>clean</code> option when set "
"to <var>yes</var>. "
"<br/>"
"If set to <var>yes</var> when using <code>clean</code>, "
"<code>&amp;emdash;</code>, <code>&amp;rdquo;</code>, and other named "
"character entities are downgraded to their closest ASCII equivalents. "
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@ -518,6 +524,8 @@ msgid ""
"This option specifies if Tidy should enable specific behavior for "
"cleaning up HTML exported from Google Docs. "
msgstr ""
"This option specifies if Tidy should enable specific behaviour for "
"cleaning up HTML exported from Google Docs. "
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@ -718,6 +726,16 @@ msgid ""
"and ensure that whitespace within attribute values is passed "
"through unchanged, set this option to <var>yes</var>. "
msgstr ""
"This option specifies how Tidy deals with whitespace characters within "
"attribute values. "
"<br/>"
"If the value is <var>no</var> Tidy normalises attribute values by "
"replacing any newline or tab with a single space, and further by replacing "
"any contiguous whitespace with a single space. "
"<br/>"
"To force Tidy to preserve the original, literal values of all attributes "
"and ensure that whitespace within attribute values is passed "
"through unchanged, set this option to <var>yes</var>. "
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@ -1302,8 +1320,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
#. Important notes for translators:
@ -1348,6 +1370,21 @@ msgid ""
"document using opening tags; matching closing tags will be recognized "
"accordingly, and unknown closing tags will be discarded. "
msgstr ""
"This option enables the use of tags for autonomous custom elements, "
"e.g. &lt;flag-icon&gt; with Tidy. Custom tags are disabled if this "
"value is <var>no</var>. Other settings - <var>blocklevel</var>, "
"<var>empty</var>, <var>inline</var>, and <var>pre</var> will treat "
"<em>all</em> detected custom tags accordingly. "
"<br/>"
"The use of <code>new-blocklevel-tags</code>, "
"<code>new-empty-tags</code>, <code>new-inline-tags</code>, or "
"<code>new-pre-tags</code> will override the treatment of custom tags "
"by this configuration option. This may be useful if you have "
"different types of custom tags."
"<br/>"
"When enabled these tags are determined during the processing of your "
"document using opening tags; matching closing tags will be recognised "
"accordingly, and unknown closing tags will be discarded. "
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@ -1646,6 +1683,20 @@ msgid ""
"error correcting HTML parser. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""
@ -2444,12 +2495,12 @@ msgstr ""
#, c-format
msgctxt "UNKNOWN_ELEMENT_LOOKS_CUSTOM"
msgid "%s is not recognized! Did you mean to enable the custom-tags option?"
msgstr ""
msgstr "%s is not recognised! Did you mean to enable the custom-tags option?"
#, c-format
msgctxt "UNKNOWN_ELEMENT"
msgid "%s is not recognized!"
msgstr ""
msgstr "%s is not recognised!"
#, c-format
msgctxt "MISSING_ATTRIBUTE"
@ -2536,6 +2587,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr ""
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr ""
@ -2626,7 +2685,7 @@ msgstr ""
msgctxt "MULTIMEDIA_REQUIRES_TEXT"
msgid "[1.4.1.1]: multimedia requires synchronized text equivalents."
msgstr ""
msgstr "[1.4.1.1]: multimedia requires synchronised text equivalents."
msgctxt "IMG_MAP_CLIENT_MISSING_TEXT_LINKS"
msgid "[1.5.1.1]: image map (client-side) missing text links."
@ -2742,7 +2801,7 @@ msgstr ""
msgctxt "LAYOUT_TABLES_LINEARIZE_PROPERLY"
msgid "[5.3.1.1]: verify layout tables linearize properly."
msgstr ""
msgstr "[5.3.1.1]: verify layout tables linearise properly."
msgctxt "LAYOUT_TABLE_INVALID_MARKUP"
msgid "[5.4.1.1]: invalid markup used in layout <table>."
@ -3466,6 +3525,14 @@ msgid ""
"Please report instances of incorrect strings to the Tidy team. \n"
"\n"
msgstr ""
"\n"
"The following languages are currently installed in Tidy. Please \n"
"note that there's no guarantee that they are complete; only that \n"
"one developer or another started to add the language indicated. \n"
"\n"
"Incomplete localisations will default to \"en\" when necessary. \n"
"Please report instances of incorrect strings to the Tidy team. \n"
"\n"
#. This console output should be limited to 78 characters per line.
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not be translated.

View File

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-05-13 21:04:45\n"
"PO-Revision-Date: 2017-08-28 10:04:30\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -1283,8 +1283,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
#. Important notes for translators:
@ -1627,6 +1631,20 @@ msgid ""
"error correcting HTML parser. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""
@ -2513,6 +2531,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr ""
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr ""

View File

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-05-13 21:04:45\n"
"PO-Revision-Date: 2017-08-28 10:04:30\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -1278,8 +1278,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
#. Important notes for translators:
@ -1622,6 +1626,20 @@ msgid ""
"error correcting HTML parser. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""
@ -2508,6 +2526,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr ""
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr ""

View File

@ -5,8 +5,8 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-05-16 22:36:48\n"
"Last-Translator: seb\n"
"PO-Revision-Date: 2017-08-28 10:04:31\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
#. Important notes for translators:
@ -1522,8 +1522,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
"Cette option précise si Tidy doit afficher les noms d'attributs en majuscules. <br/>La valeur par "
"défaut est <var>no</var>, ce qui produit un affichage des attributs en minuscules, excepté pour une "
@ -1941,6 +1945,20 @@ msgstr ""
"Cette option précise si Tidy doit utiliser l'analyseur XML plutôt que l'analyseur de correction "
"d'erreur HTML."
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr "catégorie inconnue!"
@ -2953,6 +2971,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr "</%s> inattendu"
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr "[1.1.1.1]: <img> texte manquant 'alt'."

View File

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-05-13 21:04:45\n"
"PO-Revision-Date: 2017-08-28 10:04:31\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -1278,8 +1278,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
#. Important notes for translators:
@ -1622,6 +1626,20 @@ msgid ""
"error correcting HTML parser. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""
@ -2502,6 +2520,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr ""
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr ""

View File

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"POT-Creation-Date: 2017-03-22 15:54:52\n"
"POT-Creation-Date: 2017-08-28 10:04:30\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -299,32 +299,6 @@ msgctxt "TidyDropEmptyParas"
msgid "This option specifies if Tidy should discard empty paragraphs. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyDropFontTags"
msgid ""
"Deprecated; <em>do not use</em>. This option is destructive to "
"<code>&lt;font&gt;</code> tags, and it will be removed from future "
"versions of Tidy. Use the <code>clean</code> option instead. "
"<br/>"
"If you do set this option despite the warning it will perform "
"as <code>clean</code> except styles will be inline instead of put into "
"a CSS class. <code>&lt;font&gt;</code> tags will be dropped completely "
"and their styles will not be preserved. "
"<br/>"
"If both <code>clean</code> and this option are enabled, "
"<code>&lt;font&gt;</code> tags will still be dropped completely, and "
"other styles will be preserved in a CSS class instead of inline. "
"<br/>"
"See <code>clean</code> for more information. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
@ -557,18 +531,6 @@ msgctxt "TidyHideComments"
msgid "This option specifies if Tidy should print out comments. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyHideEndTags"
msgid "This option is an alias for <code>omit-optional-tags</code>. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
@ -1277,10 +1239,10 @@ msgstr ""
msgctxt "TidyStrictTagsAttr"
msgid ""
"This options ensures that tags and attributes are applicable for the "
"version of HTML that Tidy outputs. When set to <var>yes</var> (the "
"default) and the output document type is a strict doctype, then Tidy "
"will report errors. If the output document type is a loose or "
"transitional doctype, then Tidy will report warnings. "
"version of HTML that Tidy outputs. When set to <var>yes</var> and the "
"output document type is a strict doctype, then Tidy will report "
"errors. If the output document type is a loose or transitional "
"doctype, then Tidy will report warnings. "
"<br/>"
"Additionally if <code>drop-proprietary-attributes</code> is enabled, "
"then not applicable attributes will be dropped, too. "
@ -1316,8 +1278,12 @@ msgid ""
"This option specifies if Tidy should output attribute names in upper "
"case. "
"<br/>"
"The default is <var>no</var>, which results in lower case attribute "
"names, except for XML input, where the original case is preserved. "
"When set to <var>no</var>, attribute names will be written in lower "
"case. Specifying <var>yes</var> will output attribute names in upper "
"case, and <var>preserve</var> can used to leave attribute names "
"untouched. "
"<br/>"
"When using XML input, the original case is always preserved. "
msgstr ""
#. Important notes for translators:
@ -1382,6 +1348,18 @@ msgid ""
"characters."
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyWarnPropAttrs"
msgid "This option specifies if Tidy should warn on proprietary attributes."
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
@ -1648,6 +1626,20 @@ msgid ""
"error correcting HTML parser. "
msgstr ""
#. Important notes for translators:
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
#. <br/>.
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
#. - Option values should be enclosed in <var></var>.
#. - It's very important that <br/> be self-closing!
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
#. be translated.
msgctxt "TidyStyleTags"
msgid ""
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
msgstr ""
msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""
@ -1721,6 +1713,11 @@ msgctxt "FILE_CANT_OPEN"
msgid "Can't open \"%s\"\n"
msgstr ""
#, c-format
msgctxt "FILE_NOT_FILE"
msgid "\"%s\" is not a file!\n"
msgstr ""
#, c-format
msgctxt "LINE_COLUMN_STRING"
msgid "line %d column %d - "
@ -1856,16 +1853,6 @@ msgid ""
" TD cells that set the axis attribute are also treated as header cells.\n"
msgstr ""
#. This console output should be limited to 78 characters per line.
msgctxt "TEXT_WINDOWS_CHARS"
msgid ""
"Characters codes for the Microsoft Windows fonts in the range\n"
"128 - 159 may not be recognized on other platforms. You are\n"
"instead recommended to use named entities, e.g. &trade; rather\n"
"than Windows character code 153 (0x2122 in Unicode). Note that\n"
"as of February 1998 few browsers support the new entities.\n"
msgstr ""
#. This console output should be limited to 78 characters per line.
#. - %s represents a string-encoding name which may be localized in your language.
#, c-format
@ -2113,6 +2100,11 @@ msgctxt "ID_NAME_MISMATCH"
msgid "%s id and name attribute value mismatch"
msgstr ""
#, c-format
msgctxt "ILLEGAL_URI_CODEPOINT"
msgid "%s illegal characters found in URI"
msgstr ""
#, c-format
msgctxt "ILLEGAL_URI_REFERENCE"
msgid "%s improperly escaped URI reference"
@ -2530,6 +2522,14 @@ msgctxt "UNEXPECTED_ENDTAG"
msgid "unexpected </%s>"
msgstr ""
msgctxt "MOVED_STYLE_TO_HEAD"
msgid "moved <style> tag to <head>! fix-style-tags: no to avoid."
msgstr ""
msgctxt "FOUND_STYLE_IN_BODY"
msgid "found <style> tag in <body>! fix-style-tags: yes to move."
msgstr ""
msgctxt "IMG_MISSING_ALT"
msgid "[1.1.1.1]: <img> missing 'alt' text."
msgstr ""

View File

@ -2866,6 +2866,57 @@ void TY_(FixAnchors)(TidyDocImpl* doc, Node *node, Bool wantName, Bool wantId)
}
}
/* Issue #567 - move style elements from body to head
* ==================================================
*/
static void StyleToHead(TidyDocImpl* doc, Node *head, Node *node, Bool fix, int indent)
{
Node *next;
while (node)
{
next = node->next; /* get 'next' now , in case the node is moved */
/* dbg_show_node(doc, node, 0, indent); */
if (nodeIsSTYLE(node))
{
if (fix)
{
TY_(RemoveNode)(node); /* unhook style node from body */
TY_(InsertNodeAtEnd)(head, node); /* add to end of head */
TY_(ReportNotice)(doc, node, head, MOVED_STYLE_TO_HEAD); /* report move */
}
else
{
TY_(ReportNotice)(doc, node, head, FOUND_STYLE_IN_BODY);
}
}
else if (node->content)
{
StyleToHead(doc, head, node->content, fix, indent + 1);
}
node = next; /* process the 'next', if any */
}
}
void TY_(CleanStyle)(TidyDocImpl* doc, Node *html)
{
Node *head = NULL, *body = NULL;
Bool fix = cfgBool(doc, TidyStyleTags);
if (!html)
return; /* oops, not given a start node */
head = TY_(FindHEAD)( doc );
body = TY_(FindBody)( doc );
if ((head != NULL) && (body != NULL))
{
StyleToHead(doc, head, body, fix, 0); /* found head and body */
}
}
/* ==================================================
*/
/*
* local variables:
* mode: c

View File

@ -81,5 +81,7 @@ void TY_(FixAnchors)(TidyDocImpl* doc, Node *node, Bool wantName, Bool wantId);
void TY_(FixXhtmlNamespace)(TidyDocImpl* doc, Bool wantXmlns);
void TY_(FixLanguageInformation)(TidyDocImpl* doc, Node* node, Bool wantXmlLang, Bool wantLang);
/* Issue #567 - move style elements from body to head */
void TY_(CleanStyle)(TidyDocImpl* doc, Node *html);
#endif /* __CLEAN_H__ */

View File

@ -262,6 +262,7 @@ static const TidyOptionImpl option_defs[] =
{ TidyMergeDivs, MU, "merge-divs", IN, TidyAutoState, ParsePickList, &autoBoolPicks },
{ TidyMergeEmphasis, MU, "merge-emphasis", BL, yes, ParsePickList, &boolPicks },
{ TidyMergeSpans, MU, "merge-spans", IN, TidyAutoState, ParsePickList, &autoBoolPicks },
{ TidyMetaCharset, MS, "add-meta-charset", BL, no, ParsePickList, &boolPicks }, /* 20161004 - Issue #456 */
#if SUPPORT_ASIAN_ENCODINGS
{ TidyNCR, MU, "ncr", BL, yes, ParsePickList, &boolPicks },
#endif
@ -279,42 +280,42 @@ static const TidyOptionImpl option_defs[] =
#if SUPPORT_ASIAN_ENCODINGS
{ TidyPunctWrap, PP, "punctuation-wrap", BL, no, ParsePickList, &boolPicks },
#endif
{ TidyQuiet, MS, "quiet", BL, no, ParsePickList, &boolPicks },
{ TidyQuoteAmpersand, MU, "quote-ampersand", BL, yes, ParsePickList, &boolPicks },
{ TidyQuoteMarks, MU, "quote-marks", BL, no, ParsePickList, &boolPicks },
{ TidyQuoteNbsp, MU, "quote-nbsp", BL, yes, ParsePickList, &boolPicks },
{ TidyReplaceColor, MU, "replace-color", BL, no, ParsePickList, &boolPicks },
{ TidyShowErrors, DG, "show-errors", IN, 6, ParseInt, NULL },
{ TidyShowInfo, DG, "show-info", BL, yes, ParsePickList, &boolPicks },
{ TidyShowMarkup, PP, "markup", BL, yes, ParsePickList, &boolPicks },
{ TidyShowWarnings, DG, "show-warnings", BL, yes, ParsePickList, &boolPicks },
{ TidySkipNested, MU, "skip-nested", BL, yes, ParsePickList, &boolPicks }, /* 1642186 - Issue #65 */
{ TidySortAttributes, PP, "sort-attributes", IN, TidySortAttrNone,ParsePickList, &sorterPicks },
{ TidyStrictTagsAttr, MU, "strict-tags-attributes", BL, no, ParsePickList, &boolPicks }, /* 20160209 - Issue #350 */
{ TidyTabSize, PP, "tab-size", IN, 8, ParseInt, NULL },
{ TidyQuiet, MS, "quiet", BL, no, ParsePickList, &boolPicks },
{ TidyQuoteAmpersand, MU, "quote-ampersand", BL, yes, ParsePickList, &boolPicks },
{ TidyQuoteMarks, MU, "quote-marks", BL, no, ParsePickList, &boolPicks },
{ TidyQuoteNbsp, MU, "quote-nbsp", BL, yes, ParsePickList, &boolPicks },
{ TidyReplaceColor, MU, "replace-color", BL, no, ParsePickList, &boolPicks },
{ TidyShowErrors, DG, "show-errors", IN, 6, ParseInt, NULL },
{ TidyShowInfo, DG, "show-info", BL, yes, ParsePickList, &boolPicks },
{ TidyShowMarkup, PP, "markup", BL, yes, ParsePickList, &boolPicks },
{ TidyShowMetaChange, MS, "show-meta-change", BL, no, ParsePickList, &boolPicks }, /* 20170609 - Issue #456 */
{ TidyShowWarnings, DG, "show-warnings", BL, yes, ParsePickList, &boolPicks },
{ TidySkipNested, MU, "skip-nested", BL, yes, ParsePickList, &boolPicks }, /* 1642186 - Issue #65 */
{ TidySortAttributes, PP, "sort-attributes", IN, TidySortAttrNone,ParsePickList, &sorterPicks },
{ TidyStrictTagsAttr, MU, "strict-tags-attributes", BL, no, ParsePickList, &boolPicks }, /* 20160209 - Issue #350 */
{ TidyStyleTags, MU, "fix-style-tags", BL, yes, ParsePickList, &boolPicks },
{ TidyTabSize, PP, "tab-size", IN, 8, ParseInt, NULL },
{ TidyUpperCaseAttrs, MU, "uppercase-attributes", IN, TidyUppercaseNo, ParsePickList, &attributeCasePicks },
{ TidyUpperCaseTags, MU, "uppercase-tags", BL, no, ParsePickList, &boolPicks },
{ TidyUseCustomTags, MU, "custom-tags", IN, TidyCustomNo, ParsePickList, &customTagsPicks }, /* 20170309 - Issue #119 */
{ TidyVertSpace, PP, "vertical-space", IN, no, ParsePickList, &autoBoolPicks }, /* #228 - tri option */
{ TidyWarnPropAttrs, MU, "warn-proprietary-attributes", BL, yes, ParsePickList, &boolPicks },
{ TidyWord2000, MU, "word-2000", BL, no, ParsePickList, &boolPicks },
{ TidyWrapAsp, PP, "wrap-asp", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParsePickList, &boolPicks },
{ TidyWrapJste, PP, "wrap-jste", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapLen, PP, "wrap", IN, 68, ParseInt, NULL },
{ TidyWrapPhp, PP, "wrap-php", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapScriptlets, PP, "wrap-script-literals", BL, no, ParsePickList, &boolPicks },
{ TidyWrapSection, PP, "wrap-sections", BL, yes, ParsePickList, &boolPicks },
{ TidyWriteBack, MS, "write-back", BL, no, ParsePickList, &boolPicks },
{ TidyXhtmlOut, MU, "output-xhtml", BL, no, ParsePickList, &boolPicks },
{ TidyXmlDecl, MU, "add-xml-decl", BL, no, ParsePickList, &boolPicks },
{ TidyXmlOut, MU, "output-xml", BL, no, ParsePickList, &boolPicks },
{ TidyXmlPIs, MU, "assume-xml-procins", BL, no, ParsePickList, &boolPicks },
{ TidyXmlSpace, MU, "add-xml-space", BL, no, ParsePickList, &boolPicks },
{ TidyXmlTags, MU, "input-xml", BL, no, ParsePickList, &boolPicks },
{ TidyMetaCharset, MS, "add-meta-charset", BL, no, ParsePickList, &boolPicks }, /* 20161004 - Issue #456 */
{ TidyShowMetaChange, MS, "show-meta-change", BL, no, ParsePickList, &boolPicks }, /* 20170609 - Issue #456 */
{ N_TIDY_OPTIONS, XX, NULL, XY, 0, NULL, NULL }
{ TidyUpperCaseTags, MU, "uppercase-tags", BL, no, ParsePickList, &boolPicks },
{ TidyUseCustomTags, MU, "custom-tags", IN, TidyCustomNo, ParsePickList, &customTagsPicks }, /* 20170309 - Issue #119 */
{ TidyVertSpace, PP, "vertical-space", IN, no, ParsePickList, &autoBoolPicks }, /* #228 - tri option */
{ TidyWarnPropAttrs, MU, "warn-proprietary-attributes", BL, yes, ParsePickList, &boolPicks },
{ TidyWord2000, MU, "word-2000", BL, no, ParsePickList, &boolPicks },
{ TidyWrapAsp, PP, "wrap-asp", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParsePickList, &boolPicks },
{ TidyWrapJste, PP, "wrap-jste", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapLen, PP, "wrap", IN, 68, ParseInt, NULL },
{ TidyWrapPhp, PP, "wrap-php", BL, yes, ParsePickList, &boolPicks },
{ TidyWrapScriptlets, PP, "wrap-script-literals", BL, no, ParsePickList, &boolPicks },
{ TidyWrapSection, PP, "wrap-sections", BL, yes, ParsePickList, &boolPicks },
{ TidyWriteBack, MS, "write-back", BL, no, ParsePickList, &boolPicks },
{ TidyXhtmlOut, MU, "output-xhtml", BL, no, ParsePickList, &boolPicks },
{ TidyXmlDecl, MU, "add-xml-decl", BL, no, ParsePickList, &boolPicks },
{ TidyXmlOut, MU, "output-xml", BL, no, ParsePickList, &boolPicks },
{ TidyXmlPIs, MU, "assume-xml-procins", BL, no, ParsePickList, &boolPicks },
{ TidyXmlSpace, MU, "add-xml-space", BL, no, ParsePickList, &boolPicks },
{ TidyXmlTags, MU, "input-xml", BL, no, ParsePickList, &boolPicks },
{ N_TIDY_OPTIONS, XX, NULL, XY, 0, NULL, NULL }
};
@ -819,13 +820,14 @@ int TY_(ParseConfigFileEnc)( TidyDocImpl* doc, ctmbstr file, ctmbstr charenc )
option->parser( doc, option );
else
{
if (NULL != doc->pOptCallback)
if ( (NULL != doc->pOptCallback) || (NULL != doc->pConfigCallback) )
{
TidyConfigImpl* cfg = &doc->config;
tmbchar buf[8192];
uint i = 0;
tchar delim = 0;
Bool waswhite = yes;
Bool response = yes;
tchar c = SkipWhite( cfg );
@ -856,7 +858,14 @@ int TY_(ParseConfigFileEnc)( TidyDocImpl* doc, ctmbstr file, ctmbstr charenc )
c = AdvanceChar( cfg );
}
buf[i] = '\0';
if (no == (*doc->pOptCallback)( name, buf ))
if ( doc->pOptCallback )
response = response && (*doc->pOptCallback)( name, buf );
if ( doc->pConfigCallback )
response = response && (*doc->pConfigCallback)( tidyImplToDoc(doc), name, buf );
if (response == no)
TY_(ReportUnknownOption)( doc, name );
}
else

View File

@ -1521,14 +1521,37 @@ static languageDefinition language_en = { whichPluralForm_en, {
- The strings "Tidy" and "HTML Tidy" are the program name and must not
be translated. */
TidyMetaCharset, 0,
"This option adds a meta element and sets the charset attribute to the encoding of the document."
" Set this option to <var>yes</var> if you want this."
"This option, when enabled, adds a <code>&lt;meta&gt;</code> element "
"and sets the <code>charset</code> attribute to the encoding of the "
"document. Set this option to <var>yes</var> to enable it. "
},
{
{/* Important notes for translators:
- Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
<br/>.
- Entities, tags, attributes, etc., should be enclosed in <code></code>.
- Option values should be enclosed in <var></var>.
- It's very important that <br/> be self-closing!
- The strings "Tidy" and "HTML Tidy" are the program name and must not
be translated. */
TidyShowMetaChange, 0,
"This option shows when a meta http-equiv content charset attribute was changed to the encoding of the document."
" Set this option to <var>yes</var> if you want this."
"This option enables a message whenever Tidy changes the "
"<code>content</code> attribute of a meta charset declaration to match "
"the encoding of the document. Set this option to <var>yes</var> to "
"enable it. "
},
{/* Important notes for translators:
- Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
<br/>.
- Entities, tags, attributes, etc., should be enclosed in <code></code>.
- Option values should be enclosed in <var></var>.
- It's very important that <br/> be self-closing!
- The strings "Tidy" and "HTML Tidy" are the program name and must not
be translated. */
TidyStyleTags, 0,
"This option specifies if Tidy should move all style tags to the "
"head of the document. "
},
/********************************************
** TidyConfigCategory enumeration
@ -1792,6 +1815,7 @@ static languageDefinition language_en = { whichPluralForm_en, {
"https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md"
},
/********************************************
** Report Output
** @remark enum source TidyStrings
@ -1800,10 +1824,10 @@ static languageDefinition language_en = { whichPluralForm_en, {
{ ANCHOR_NOT_UNIQUE, 0, "%s anchor \"%s\" already defined" }, /* ReportAttrError */
{ ATTR_VALUE_NOT_LCASE, 0, "%s attribute value \"%s\" must be lower case for XHTML" }, /* ReportAttrError */
{ ATTRIBUTE_IS_NOT_ALLOWED, 0, "%s attribute \"is\" not allowed for autonomous custom tags." }, /* ReportAttrError */
{ ATTRIBUTE_VALUE_REPLACED, 0, "%s attribute \"%s\", incorrect value \"%s\" replaced" }, /* ReportAttrError/TidyInfo */
{ BACKSLASH_IN_URI, 0, "%s URI reference contains backslash. Typo?" }, /* ReportAttrError */
{ BAD_ATTRIBUTE_VALUE_REPLACED, 0, "%s attribute \"%s\" had invalid value \"%s\" and has been replaced" }, /* ReportAttrError */
{ BAD_ATTRIBUTE_VALUE, 0, "%s attribute \"%s\" has invalid value \"%s\"" }, /* ReportAttrError */
{ ATTRIBUTE_VALUE_REPLACED, 0, "%s attribute \"%s\", incorrect value \"%s\" replaced" }, /* ReportAttrError/TidyInfo */
{ ESCAPED_ILLEGAL_URI, 0, "%s escaping malformed URI reference" }, /* ReportAttrError */
{ FIXED_BACKSLASH, 0, "%s converting backslash in URI to slash" }, /* ReportAttrError */
{ ID_NAME_MISMATCH, 0, "%s id and name attribute value mismatch" }, /* ReportAttrError */
@ -1906,6 +1930,8 @@ static languageDefinition language_en = { whichPluralForm_en, {
{ ELEMENT_NOT_EMPTY, 0, "%s element not empty or not closed" }, /* ReportError, ReportAttrError */
{ UNEXPECTED_END_OF_FILE, 0, "unexpected end of file %s" }, /* ReportError, ReportAttrError */
{ UNEXPECTED_ENDTAG, 0, "unexpected </%s>" }, /* ReportError, ReportFatal */
{ MOVED_STYLE_TO_HEAD, 0, "moved <style> tag to <head>! fix-style-tags: no to avoid." }, /* ReportWarning */
{ FOUND_STYLE_IN_BODY, 0, "found <style> tag in <body>! fix-style-tags: yes to move." }, /* ReportWarning */
{ ADDED_MISSING_CHARSET, 0, "Added appropriate missing <meta charset=...> to %s" }, /* ReportInfo */

View File

@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
* PO_REVISION_DATE=2017-05-13 21:04:45
* PO_REVISION_DATE=2017-08-28 10:04:30
*/
#ifdef _MSC_VER
@ -59,9 +59,33 @@ static languageDefinition language_en_gb = { whichPluralForm_en_gb, {
** Specify the code for this language.
***************************************/
{/* Specify the ll or ll_cc language code here. */
TIDY_LANGUAGE, 0, "en_gb"
TIDY_LANGUAGE, 0, "en_gb"
},
{ TidyMergeDivs, 0,
{ TidyAsciiChars, 0,
"Can be used to modify behaviour of the <code>clean</code> option when set "
"to <var>yes</var>. "
"<br/>"
"If set to <var>yes</var> when using <code>clean</code>, "
"<code>&amp;emdash;</code>, <code>&amp;rdquo;</code>, and other named "
"character entities are downgraded to their closest ASCII equivalents. "
},
{ TidyGDocClean, 0,
"This option specifies if Tidy should enable specific behaviour for "
"cleaning up HTML exported from Google Docs. "
},
{ TidyLiteralAttribs, 0,
"This option specifies how Tidy deals with whitespace characters within "
"attribute values. "
"<br/>"
"If the value is <var>no</var> Tidy normalises attribute values by "
"replacing any newline or tab with a single space, and further by replacing "
"any contiguous whitespace with a single space. "
"<br/>"
"To force Tidy to preserve the original, literal values of all attributes "
"and ensure that whitespace within attribute values is passed "
"through unchanged, set this option to <var>yes</var>. "
},
{ TidyMergeDivs, 0,
"This option can be used to modify the behaviour of <code>clean</code> when "
"set to <code>yes</code>."
"<br/>"
@ -77,7 +101,7 @@ static languageDefinition language_en_gb = { whichPluralForm_en_gb, {
"<code>&lt;div&gt;</code> are discarded with the exception of "
"<code>class</code> and <code>style</code>. "
},
{ TidyMergeSpans, 0,
{ TidyMergeSpans, 0,
"This option can be used to modify the behaviour of <code>clean</code> when "
"set to <code>yes</code>."
"<br/>"
@ -86,39 +110,74 @@ static languageDefinition language_en_gb = { whichPluralForm_en_gb, {
"<br/>"
"The algorithm is identical to the one used by <code>merge-divs</code>. "
},
{ TidyReplaceColor, 0,
{ TidyReplaceColor, 0,
"This option specifies if Tidy should replace numeric values in colour "
"attributes with HTML/XHTML colour names where defined, e.g. replace "
"<code>#ffffff</code> with <code>white</code>. "
},
{ TEXT_USING_FONT, 0,
{ TidyUseCustomTags, 0,
"This option enables the use of tags for autonomous custom elements, "
"e.g. &lt;flag-icon&gt; with Tidy. Custom tags are disabled if this "
"value is <var>no</var>. Other settings - <var>blocklevel</var>, "
"<var>empty</var>, <var>inline</var>, and <var>pre</var> will treat "
"<em>all</em> detected custom tags accordingly. "
"<br/>"
"The use of <code>new-blocklevel-tags</code>, "
"<code>new-empty-tags</code>, <code>new-inline-tags</code>, or "
"<code>new-pre-tags</code> will override the treatment of custom tags "
"by this configuration option. This may be useful if you have "
"different types of custom tags."
"<br/>"
"When enabled these tags are determined during the processing of your "
"document using opening tags; matching closing tags will be recognised "
"accordingly, and unknown closing tags will be discarded. "
},
{ TEXT_USING_FONT, 0,
"You are recommended to use CSS to specify the font and\n"
"properties such as its size and colour. This will reduce\n"
"the size of HTML files and make them easier to maintain\n"
"compared with using <FONT> elements.\n\n"
},
{ TEXT_USING_BODY, 0, "You are recommended to use CSS to specify page and link colours\n" },
{ TEXT_GENERAL_INFO_PLEA, 0,
{ TEXT_USING_BODY, 0, "You are recommended to use CSS to specify page and link colours\n" },
{ TEXT_GENERAL_INFO_PLEA, 0,
"\n"
"Would you like to see Tidy in proper, British English? Please consider \n"
"helping us to localise HTML Tidy. For details please see \n"
"https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md\n"
},
{ UNKNOWN_ELEMENT_LOOKS_CUSTOM, 0, "%s is not recognised! Did you mean to enable the custom-tags option?" },
{ UNKNOWN_ELEMENT, 0, "%s is not recognised!" },
#if SUPPORT_ACCESSIBILITY_CHECKS
{ INFORMATION_NOT_CONVEYED_IMAGE, 0, "[2.1.1.1]: ensure information not conveyed through colour alone (image)." },
{ INFORMATION_NOT_CONVEYED_APPLET, 0, "[2.1.1.2]: ensure information not conveyed through colour alone (applet)." },
{ INFORMATION_NOT_CONVEYED_OBJECT, 0, "[2.1.1.3]: ensure information not conveyed through colour alone (object)." },
{ INFORMATION_NOT_CONVEYED_SCRIPT, 0, "[2.1.1.4]: ensure information not conveyed through colour alone (script)." },
{ INFORMATION_NOT_CONVEYED_INPUT, 0, "[2.1.1.5]: ensure information not conveyed through colour alone (input)." },
{ COLOR_CONTRAST_TEXT, 0, "[2.2.1.1]: poor colour contrast (text)." },
{ COLOR_CONTRAST_LINK, 0, "[2.2.1.2]: poor colour contrast (link)." },
{ COLOR_CONTRAST_ACTIVE_LINK, 0, "[2.2.1.3]: poor colour contrast (active link)." },
{ COLOR_CONTRAST_VISITED_LINK, 0, "[2.2.1.4]: poor colour contrast (visited link)." },
{ MULTIMEDIA_REQUIRES_TEXT, 0, "[1.4.1.1]: multimedia requires synchronised text equivalents." },
{ INFORMATION_NOT_CONVEYED_IMAGE, 0, "[2.1.1.1]: ensure information not conveyed through colour alone (image)." },
{ INFORMATION_NOT_CONVEYED_APPLET, 0, "[2.1.1.2]: ensure information not conveyed through colour alone (applet)." },
{ INFORMATION_NOT_CONVEYED_OBJECT, 0, "[2.1.1.3]: ensure information not conveyed through colour alone (object)." },
{ INFORMATION_NOT_CONVEYED_SCRIPT, 0, "[2.1.1.4]: ensure information not conveyed through colour alone (script)." },
{ INFORMATION_NOT_CONVEYED_INPUT, 0, "[2.1.1.5]: ensure information not conveyed through colour alone (input)." },
{ COLOR_CONTRAST_TEXT, 0, "[2.2.1.1]: poor colour contrast (text)." },
{ COLOR_CONTRAST_LINK, 0, "[2.2.1.2]: poor colour contrast (link)." },
{ COLOR_CONTRAST_ACTIVE_LINK, 0, "[2.2.1.3]: poor colour contrast (active link)." },
{ COLOR_CONTRAST_VISITED_LINK, 0, "[2.2.1.4]: poor colour contrast (visited link)." },
{ LAYOUT_TABLES_LINEARIZE_PROPERLY, 0, "[5.3.1.1]: verify layout tables linearise properly." },
#endif /* SUPPORT_ACCESSIBILITY_CHECKS */
#if SUPPORT_CONSOLE_APP
{ TC_TXT_HELP_LANG_2, 0,
"\n"
"The following languages are currently installed in Tidy. Please \n"
"note that there's no guarantee that they are complete; only that \n"
"one developer or another started to add the language indicated. \n"
"\n"
"Incomplete localisations will default to \"en\" when necessary. \n"
"Please report instances of incorrect strings to the Tidy team. \n"
"\n"
},
#endif /* SUPPORT_CONSOLE_APP */
{/* This MUST be present and last. */
TIDY_MESSAGE_TYPE_LAST, 0, NULL
TIDY_MESSAGE_TYPE_LAST, 0, NULL
}
}};

View File

@ -249,6 +249,11 @@ void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code)
}
message = TY_(tidyMessageCreateWithNode)(doc, element, code, TidyInfo, elemdesc, tagtype );
break;
case MOVED_STYLE_TO_HEAD:
case FOUND_STYLE_IN_BODY:
TagToString(element, elemdesc, sizeof(elemdesc));
message = TY_(tidyMessageCreateWithNode)(doc, element, code, TidyWarning, elemdesc);
break;
}
messageOut( message );

View File

@ -2435,6 +2435,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
Lexer* lexer = doc->lexer;
Node *node, *parent, *lastli;
Bool wasblock;
Bool nodeisOL = nodeIsOL(list);
#if !defined(NDEBUG) && defined(_MSC_VER)
in_parse_list++;
@ -2452,6 +2453,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
while ((node = TY_(GetToken)( doc, IgnoreWhitespace)) != NULL)
{
Bool foundLI = no;
if (node->tag == list->tag && node->type == EndTag)
{
TY_(FreeNode)( doc, node);
@ -2473,6 +2475,21 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
TY_(FreeNode)( doc, node);
continue;
}
if (lexer && (node->type == TextNode))
{
uint ch, ix = node->start;
/* Issue #572 - Skip whitespace. */
while (ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
&& (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'))
++ix;
if (ix >= node->end)
{
/* Issue #572 - Discard if ALL whitespace. */
TY_(FreeNode)(doc, node);
continue;
}
}
/*
if this is the end tag for an ancestor element
@ -2521,10 +2538,16 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
continue;
}
if ( nodeIsLI(node) || TY_(IsHTML5Mode)(doc))
if ( !nodeIsLI(node) && nodeisOL )
{
/* node is <LI>
Issue #396 - A <ul> can have Zero or more li elements
/* Issue #572 - A <ol><li> can have nested <ol> elements */
foundLI = FindLastLI(list, &lastli); /* find last <li> */
}
if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
{
/* node is <LI> OR
Issue #396 - A <ul> can have Zero or more <li> elements
*/
TY_(InsertNodeAtEnd)(list,node);
}

View File

@ -2340,7 +2340,8 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
else /* other tags */
{
Bool indcont = ( cfgAutoBool(doc, TidyIndentContent) != TidyNoState );
Bool indsmart = ( cfgAutoBool(doc, TidyIndentContent) == TidyAutoState );
/* Issue #582 - Seems this is no longer used
Bool indsmart = ( cfgAutoBool(doc, TidyIndentContent) == TidyAutoState ); */
Bool hideend = cfgBool( doc, TidyOmitOptionalTags );
Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
uint contentIndent = indent;
@ -2360,9 +2361,11 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
* Issue #180 - with the above PCondFlushLine,
* this adds an uneccessary additional line!
* Maybe only if 'classic' ie --vertical-space yes
* Issue #582 - maybe this is no longer needed!
* It adds a 3rd newline if indent: auto...
* if ( indsmart && node->prev != NULL && classic)
* TY_(PFlushLineSmart)( doc, indent );
\*/
if ( indsmart && node->prev != NULL && classic)
TY_(PFlushLineSmart)( doc, indent );
/* do not omit elements with attributes */
if ( !hideend || !TY_(nodeHasCM)(node, CM_OMITST) ||

View File

@ -60,6 +60,7 @@ struct _TidyDocImpl
TidyReportCallback reportCallback;
TidyMessageCallback messageCallback;
TidyOptCallback pOptCallback;
TidyConfigCallback pConfigCallback;
TidyPPProgress progressCallback;
/* Parse + Repair Results */

View File

@ -232,6 +232,17 @@ Bool TIDY_CALL tidySetOptionCallback( TidyDoc tdoc, TidyOptCallback pOptC
return no;
}
Bool TIDY_CALL tidySetConfigCallback(TidyDoc tdoc, TidyConfigCallback pConfigCallback)
{
TidyDocImpl* impl = tidyDocToImpl( tdoc );
if ( impl )
{
impl->pConfigCallback = pConfigCallback;
return yes;
}
return no;
}
int TIDY_CALL tidyLoadConfig( TidyDoc tdoc, ctmbstr cfgfil )
{
@ -2011,6 +2022,9 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc )
if (tidyXmlTags)
return tidyDocStatus( doc );
/* Issue #567 - move style elements from body to head */
TY_(CleanStyle)(doc, &doc->root);
/* simplifies <b><b> ... </b> ...</b> etc. */
if ( mergeEmphasis )
TY_(NestedEmphasis)( doc, &doc->root );

View File

@ -126,6 +126,13 @@ int TY_(tmbstrcasecmp)( ctmbstr s1, ctmbstr s2 )
int TY_(tmbstrncmp)( ctmbstr s1, ctmbstr s2, uint n )
{
if (s1 == NULL || s2 == NULL)
{
if (s1 == s2)
return 0;
return (s1 == NULL ? -1 : 1);
}
uint c;
while ((c = (byte)*s1) == (byte)*s2)

View File

@ -1,2 +1,2 @@
5.5.31
2017.05.30
5.5.34
2017.08.28