From fe7c6e971b4ee1a87c044393962e3412dc141233 Mon Sep 17 00:00:00 2001 From: alandefreitas Date: Wed, 15 Jan 2025 17:28:47 -0300 Subject: [PATCH] asciidoc tilde escaped as U+007E #fix fix #804 --- src/lib/Gen/adoc/AdocEscape.cpp | 8 +++++++- test-files/golden-tests/javadoc/ref.adoc | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/Gen/adoc/AdocEscape.cpp b/src/lib/Gen/adoc/AdocEscape.cpp index c5793a899..ca00fe28d 100644 --- a/src/lib/Gen/adoc/AdocEscape.cpp +++ b/src/lib/Gen/adoc/AdocEscape.cpp @@ -24,7 +24,13 @@ HTMLNamedEntity(char const c) // Otherwise, we return std::nullopt switch (c) { - case '~': return "˜"; + // There's no named entity for '~' (U+007E / ~) in HTML + // - "˜" represents a small tilde (U+02DC) + // - "∼" or "∼" represent the tilde operator (U+223C) + // The 'tilde operator' (U+223C) is not the same character as + // "tilde" (U+007E) although the same glyph might be used to + // represent both. + // case '~': return "˜"; case '^': return "ˆ"; case '_': return "_"; case '*': return "*"; diff --git a/test-files/golden-tests/javadoc/ref.adoc b/test-files/golden-tests/javadoc/ref.adoc index 3495e731e..02bc9b255 100644 --- a/test-files/golden-tests/javadoc/ref.adoc +++ b/test-files/golden-tests/javadoc/ref.adoc @@ -36,7 +36,7 @@ | <> -| See xref:#F-operator_bitnot[F::operator˜] +| See xref:#F-operator_bitnot[F::operator~] @@ -355,7 +355,7 @@ struct F; | <> | <> | <> -| <> +| <> |=== @@ -931,7 +931,7 @@ operator||(<>&); ---- [#F-operator_bitnot] -== <>::operator˜ +== <>::operator~ === Synopsis @@ -942,7 +942,7 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator˜(); +operator~(); ---- [#f0] @@ -990,7 +990,7 @@ See xref:#A-f1[::A::f1] == f6 -See xref:#F-operator_bitnot[F::operator˜] +See xref:#F-operator_bitnot[F::operator~]