Escape special characters from SVG text

Ref https://github.com/GNS3/gns3-server/issues/952
pull/956/head
Julien Duponchelle 7 years ago
parent 5409d9c3f8
commit 55563b9808
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

@ -18,6 +18,7 @@
import os
import re
import uuid
import html
import asyncio
import aiohttp
@ -83,7 +84,7 @@ class Link:
"x": -10,
"y": -10,
"rotation": 0,
"text": "{}/{}".format(adapter_number, port_number),
"text": html.escape("{}/{}".format(adapter_number, port_number)),
"style": "font-size: 10; font-style: Verdana"
}

@ -17,6 +17,7 @@
import aiohttp
import asyncio
import html
import copy
import uuid
import os
@ -229,7 +230,7 @@ class Node:
self._label = {
"y": round(self._height / 2 + 10) * -1,
"text": self._name,
"text": html.escape(self._name),
"style": style,
"x": None, # None: mean the client should center it
"rotation": 0

@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import html
import json
import copy
import uuid
@ -434,7 +435,7 @@ def _convert_1_3_later(topo, topo_path):
size=int(font_info[1]),
weight=weight,
style=style,
text=note["text"]
text=html.escape(note["text"])
)
new_note = {
"drawing_id": str(uuid.uuid4()),
@ -521,7 +522,7 @@ def _convert_label(label):
"""
style = qt_font_to_style(label.get("font"), label.get("color"))
return {
"text": label["text"],
"text": html.escape(label["text"]),
"rotation": 0,
"style": style,
"x": int(label["x"]),

Loading…
Cancel
Save