Modify airframe gen to use html.escape

This commit is contained in:
Hamish Willee
2021-01-20 09:28:09 +11:00
committed by Lorenz Meier
parent d2eefbf2fb
commit 59a1148aec
+2 -1
View File
@@ -1,6 +1,7 @@
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
import codecs import codecs
import os import os
import html
class MarkdownTablesOutput(): class MarkdownTablesOutput():
def __init__(self, groups, board, image_path): def __init__(self, groups, board, image_path):
@@ -89,7 +90,7 @@ class MarkdownTablesOutput():
maintainer = param.GetMaintainer() maintainer = param.GetMaintainer()
maintainer_entry = '' maintainer_entry = ''
if maintainer != '': if maintainer != '':
maintainer_entry = '<p>Maintainer: %s</p>' % (maintainer.replace('<', '&lt;').replace('>', '&gt;')) maintainer_entry = '<p>Maintainer: %s</p>' % (html.escape(maintainer))
url = param.GetFieldValue('url') url = param.GetFieldValue('url')
name_anchor='id="%s_%s_%s"' % (group.GetClass(),group.GetName(),name) name_anchor='id="%s_%s_%s"' % (group.GetClass(),group.GetName(),name)
name_anchor=name_anchor.replace(' ','_').lower() name_anchor=name_anchor.replace(' ','_').lower()