Skip to content

Commit

Permalink
asciidoc tilde escaped as U+007E
Browse files Browse the repository at this point in the history
#fix

fix #804
  • Loading branch information
alandefreitas committed Jan 15, 2025
1 parent 0d046cb commit fe7c6e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/lib/Gen/adoc/AdocEscape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "*";
Expand Down
10 changes: 5 additions & 5 deletions test-files/golden-tests/javadoc/ref.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


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



Expand Down Expand Up @@ -355,7 +355,7 @@ struct F;
| <<F-operator_bitor,`operator&verbar;`>>
| <<F-operator_or_eq,`operator&verbar;&equals;`>>
| <<F-operator_or,`operator&verbar;&verbar;`>>
| <<F-operator_bitnot,`operator&tilde;`>>
| <<F-operator_bitnot,`operator&#126;`>>
|===


Expand Down Expand Up @@ -931,7 +931,7 @@ operator&verbar;&verbar;(<<F,F>>&);
----

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


=== Synopsis
Expand All @@ -942,7 +942,7 @@ Declared in `&lt;ref&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
operator&tilde;();
operator&#126;();
----

[#f0]
Expand Down Expand Up @@ -990,7 +990,7 @@ See xref:#A-f1[&colon;&colon;A&colon;&colon;f1]
== f6


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



Expand Down

0 comments on commit fe7c6e9

Please sign in to comment.