Skip to content

Commit fe7c6e9

Browse files
committed
asciidoc tilde escaped as U+007E
#fix fix #804
1 parent 0d046cb commit fe7c6e9

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/lib/Gen/adoc/AdocEscape.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ HTMLNamedEntity(char const c)
2424
// Otherwise, we return std::nullopt
2525
switch (c)
2626
{
27-
case '~': return "˜";
27+
// There's no named entity for '~' (U+007E / ~) in HTML
28+
// - "˜" represents a small tilde (U+02DC)
29+
// - "∼" or "∼" represent the tilde operator (U+223C)
30+
// The 'tilde operator' (U+223C) is not the same character as
31+
// "tilde" (U+007E) although the same glyph might be used to
32+
// represent both.
33+
// case '~': return "˜";
2834
case '^': return "ˆ";
2935
case '_': return "_";
3036
case '*': return "*";

test-files/golden-tests/javadoc/ref.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
| <<f6,`f6`>>
39-
| See xref:#F-operator_bitnot[F&colon;&colon;operator&tilde;]
39+
| See xref:#F-operator_bitnot[F&colon;&colon;operator&#126;]
4040

4141

4242

@@ -355,7 +355,7 @@ struct F;
355355
| <<F-operator_bitor,`operator&verbar;`>>
356356
| <<F-operator_or_eq,`operator&verbar;&equals;`>>
357357
| <<F-operator_or,`operator&verbar;&verbar;`>>
358-
| <<F-operator_bitnot,`operator&tilde;`>>
358+
| <<F-operator_bitnot,`operator&#126;`>>
359359
|===
360360

361361

@@ -931,7 +931,7 @@ operator&verbar;&verbar;(<<F,F>>&);
931931
----
932932

933933
[#F-operator_bitnot]
934-
== <<F,F>>::operator&tilde;
934+
== <<F,F>>::operator&#126;
935935

936936

937937
=== Synopsis
@@ -942,7 +942,7 @@ Declared in `&lt;ref&period;cpp&gt;`
942942
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
943943
----
944944
void
945-
operator&tilde;();
945+
operator&#126;();
946946
----
947947

948948
[#f0]
@@ -990,7 +990,7 @@ See xref:#A-f1[&colon;&colon;A&colon;&colon;f1]
990990
== f6
991991

992992

993-
See xref:#F-operator_bitnot[F&colon;&colon;operator&tilde;]
993+
See xref:#F-operator_bitnot[F&colon;&colon;operator&#126;]
994994

995995

996996

0 commit comments

Comments
 (0)