change html output to confirm to XHTML Strict
Several errors in the html output caused WebPositive to not render the file completely. Signed-off-by: Adrien Destugues <[email protected]> Fixes #12387.
This commit is contained in:
committed by
Adrien Destugues
parent
4286d20b87
commit
fe055bf343
@@ -58,9 +58,9 @@ cppRules["Operator at line end"] = re.compile('([*=/+\-\|\&\?]|\&&|\|\|)(?=\n)')
|
||||
cppRules["Missing space"] = re.compile('\){')
|
||||
cppRules["Mixed tabs/spaces"] = re.compile('( \t]|\t )+')
|
||||
cppRules["Malformed else"] = re.compile('}[ \t]*\n[ \t]*else')
|
||||
cppRules["Lines between functions > 2"] \
|
||||
cppRules["Lines between functions > 2"] \
|
||||
= re.compile('(?<=\n})([ \t]*\n){3,}(?=\n)')
|
||||
cppRules["Lines between functions < 2"] \
|
||||
cppRules["Lines between functions < 2"] \
|
||||
= re.compile('(?<=\n})([ \t]*\n){0,2}(?=.)')
|
||||
cppRules["Windows Line Ending"] = re.compile('\r')
|
||||
cppRules["Bad pointer/reference style"] \
|
||||
|
||||
@@ -27,9 +27,9 @@ def openHtml(fileList, outputFileName):
|
||||
<style type="text/css">""" + cssStyle() + """</style>
|
||||
</head>
|
||||
<body>
|
||||
<p><b>File list:</b><br>""")
|
||||
<p><b>File list:</b><br/>""")
|
||||
for fileName in fileList:
|
||||
file.write(fileName + "<br>")
|
||||
file.write(fileName + "<br/>")
|
||||
file.write("</p>")
|
||||
file.close()
|
||||
|
||||
@@ -37,7 +37,6 @@ def openHtml(fileList, outputFileName):
|
||||
def closeHtml(outputFileName):
|
||||
file = open(outputFileName, 'a')
|
||||
file.write("""
|
||||
</pre>
|
||||
</body>
|
||||
</html>""")
|
||||
|
||||
@@ -67,14 +66,14 @@ def renderHtml(text, highlights, sourceFileName, outputFileName):
|
||||
file.write('<table><tr><td><pre class="code"><span class="linenumber">')
|
||||
count = 1
|
||||
for line in temp.split('\n'):
|
||||
file.write(str(count).rjust(4)+"<br>")
|
||||
file.write(str(count).rjust(4)+"<br/>")
|
||||
count += 1
|
||||
|
||||
file.write('</span></pre></td><td><pre class="code">')
|
||||
|
||||
for line in temp.split('\n'):
|
||||
file.write('<span class="linehead"> </span>' + line.replace('\r', ' ') \
|
||||
+ '<br>')
|
||||
+ '<br/>')
|
||||
|
||||
file.write("</pre></td></tr></table>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user