www: fix tooltip met apostrof
This commit is contained in:
@@ -14,6 +14,9 @@ titles = {
|
||||
'tag.txt': 'tags'
|
||||
}
|
||||
|
||||
def e(s):
|
||||
return s.replace(''', ''')
|
||||
|
||||
omt0 = ''' onmouseover="tooltip.show('{} {}')" onmouseout="tooltip.hide()"'''
|
||||
omt1 = ''' onmouseover="tooltip.show('{} {}<br><small>{}</small>')" onmouseout="tooltip.hide()" class="tags"'''
|
||||
|
||||
@@ -47,9 +50,9 @@ with open(sys.argv[1], 'rt', encoding='utf-8') as fp:
|
||||
cols=len(aa)
|
||||
p = 100 / mx * v
|
||||
if len(aa) > 2:
|
||||
mo = omt1.format(aa[0], aa[1], aa[2])
|
||||
mo = omt1.format(e(aa[0]), e(aa[1]), e(aa[2]))
|
||||
else:
|
||||
mo = omt0.format(aa[0], aa[1])
|
||||
mo = omt0.format(e(aa[0]), e(aa[1]))
|
||||
sys.stdout.buffer.write('<tr{}><td><div style="width:{:.0f}%"></div><td>{}</tr>\n'.format(mo, p, aa[1]).encode('utf-8'))
|
||||
lineno += 1
|
||||
if lineno == 20:
|
||||
|
||||
Reference in New Issue
Block a user