Full Unicode and html entities management on link’s tooltip?

0 votes
asked May 29, 2020 in Wanted features by The-Lu (74,900 points)

Hello PlantUML Team,

From the Wanted features /11505, on V1.2020.10:

  • For Unicode: that is good for SVG, but not enough for PNG,
  • And for html entities: this is not enough.

Here are some tests:

Source file:

@startuml
file f [
test 1: with unicode   : 100 <U+02103> = 212 <U+02109> [[{test 1:\n100 <U+02103> = 212 <U+02109>}(view tooltip unicode)]] eol1
test 2: with entity hex: 100 &#x02103; = 212 &#x02109; [[{test 2:\n100 &#x02103; = 212 &#x02109;}(view tooltip entity hex)]] eol2
test 3: with entity dec: 100 &#8451; = 212 &#8457; [[{test 3:\n100 &#8451; = 212 &#8457;}(view tooltip entity dec)]] eol3
]
@enduml

Output:

Not on the PlantUML online server, because the entities are automaticaly transform on Unicode by the browser; but on command line, like:


>plantuml.jar -tsvg file.pu

SVG output:

...
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="272" x="17" y="29.9951">test 1: with unicode   : 100 ℃ = 212 ℉</text>
<a href="" target="_top" title="test 1:&#10;100 ℃ = 212 ℉" xlink:actuate="onRequest" xlink:href="" xlink:show="new" xlink:title="test 1:&#10;100 ℃ = 212 ℉" xlink:type="simple"><text fill="#0000FF" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="156" x="293" y="29.9951">(view tooltip unicode)</text></a><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="453" y="29.9951">eol1</text>

<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="408" x="17" y="46.292">test 2: with entity hex: 100 &amp;#x02103; = 212 &amp;#x02109;</text><a href="" target="_top" title="test 2:&#10;100 &amp;#x02103; = 212 &amp;#x02109;" xlink:actuate="onRequest" xlink:href="" xlink:show="new" xlink:title="test 2:&#10;100 &amp;#x02103; = 212 &amp;#x02109;" xlink:type="simple"><text fill="#0000FF" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="174" x="429" y="46.292">(view tooltip entity hex)</text></a><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="30" x="607" y="46.292">eol2</text>

<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="278" x="17" y="62.5889">test 3: with entity dec: 100 ℃ = 212 ℉</text><a href="" target="_top" title="test 3:&#10;100 &amp;#8451; = 212 &amp;#8457;" xlink:actuate="onRequest" xlink:href="" xlink:show="new" xlink:title="test 3:&#10;100 &amp;#8451; = 212 &amp;#8457;" xlink:type="simple"><text fill="#0000FF" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="174" x="299" y="62.5889">(view tooltip entity dec)</text></a><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="477" y="62.5889">eol3</text>
...

> plantuml.jar file.pu

PNG / cmap output:

<map id="file_map" name="file_map">
<area shape="rect" id="id1" href="" title="test 1:
100 <U+02103> = 212 <U+02109>" alt="" coords="260,15,393,33"/>
<area shape="rect" id="id2" href="" title="test 2:
100 &#38;#x02103; = 212 &#38;#x02109;" alt="" coords="366,33,509,50"/>
<area shape="rect" id="id3" href="" title="test 3:
100 &#38;#8451; = 212 &#38;#8457;" alt="" coords="259,50,403,68"/>
</map>

As mentionned on the wanted feature:

Could it possible (for png and svg output) to not escape '&' if it is on xml entity (&#...;)?

And for unicode, for png and cmap: convert <U+ddddd> unicode or change to html entity on cmap file.

Thanks for your corrections,
Regards,
Th.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...