Skip to content

[docs] Escape ampersand (&) in config doc generator's escapeCharacters#8552

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:docs/escape-ampersand-config-doc-generator
Open

[docs] Escape ampersand (&) in config doc generator's escapeCharacters#8552
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:docs/escape-ampersand-config-doc-generator

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #8551

  • Utils.escapeCharacters escaped < and > but not &, so an & in a config option key/default/type/enum column was left unescaped in the generated HTML.
  • Add a & -> &amp; replacement first (before </>) so the & in the produced &lt;/&gt; is not double-escaped.
  • Matches the sibling HtmlFormatter.escapeCharacters (paimon-api), which renders the Description column of the same table and already escapes &, <, >.

Tests

  • Added UtilsTest covering & escaping, order correctness (<a&b> -> &lt;a&amp;b&gt;), <wbr> preservation, and unchanged </> escaping.
  • mvn -pl paimon-docs -DfailIfNoTests=false clean install — 13 unit tests passed. Generated-docs diff is 0 (no existing option contains &), so ConfigOptionsDocsCompletenessITCase is unaffected and passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Config doc generator's Utils.escapeCharacters does not escape ampersand (&)

1 participant