Commit c7c487cc authored by Milena Boselli Rosa's avatar Milena Boselli Rosa

Correction to HTML markup warnings/errors: fix empty value for attributte name...

Correction to HTML markup warnings/errors: fix empty value for attributte name on 'a' tags and add an id to the nearest div containers.
parent 320e69da
...@@ -157,11 +157,14 @@ def output_visual(visual, path, indentstr, indentnum): ...@@ -157,11 +157,14 @@ def output_visual(visual, path, indentstr, indentnum):
logger.debug('including image for %s', visual.source) logger.debug('including image for %s', visual.source)
indent = tuple(indentstr * (indentnum + x) for x in range(3)) indent = tuple(indentstr * (indentnum + x) for x in range(3))
anchor = output_anchor(path) anchor = output_anchor(path)
id = ""
if anchor:
id = u"""id=\"{0}\"""".format(anchor)
return u"""{0[0]}<div class="difference"> return u"""{0[0]}<div class="difference">
{0[1]}<div class="diffheader"> {0[1]}<div class="diffheader">
{0[1]}<div class="diffcontrol">⊟</div> {0[1]}<div class="diffcontrol">⊟</div>
{0[1]}<div><span class="source">{1}</span> {0[1]}<div {5}><span class="source">{1}</span>
{0[2]}<a class="anchor" href="#{2}" name="{2}">\xb6</a> {0[2]}<a class="anchor" href="#{2}">\xb6</a>
{0[1]}</div> {0[1]}</div>
{0[1]}</div> {0[1]}</div>
{0[1]}<div class="difference"><img src=\"data:{3},{4}\" alt=\"compared images\" /></div> {0[1]}<div class="difference"><img src=\"data:{3},{4}\" alt=\"compared images\" /></div>
...@@ -171,12 +174,16 @@ def output_visual(visual, path, indentstr, indentnum): ...@@ -171,12 +174,16 @@ def output_visual(visual, path, indentstr, indentnum):
anchor, anchor,
visual.data_type, visual.data_type,
visual.content, visual.content,
id,
) )
def output_node_frame(difference, path, indentstr, indentnum, body): def output_node_frame(difference, path, indentstr, indentnum, body):
indent = tuple(indentstr * (indentnum + x) for x in range(3)) indent = tuple(indentstr * (indentnum + x) for x in range(3))
anchor = output_anchor(path) anchor = output_anchor(path)
id = ""
if anchor:
id = u"""id=\"{0}\"""".format(anchor)
dctrl_class, dctrl = ( dctrl_class, dctrl = (
("diffcontrol", u'⊟') ("diffcontrol", u'⊟')
if difference.has_visible_children() if difference.has_visible_children()
...@@ -185,8 +192,8 @@ def output_node_frame(difference, path, indentstr, indentnum, body): ...@@ -185,8 +192,8 @@ def output_node_frame(difference, path, indentstr, indentnum, body):
if difference.source1 == difference.source2: if difference.source1 == difference.source2:
header = u"""{0[1]}<div class="{1}">{2}</div> header = u"""{0[1]}<div class="{1}">{2}</div>
{0[1]}<div><span class="diffsize">{3}</span></div> {0[1]}<div><span class="diffsize">{3}</span></div>
{0[1]}<div><span class="source">{5}</span> {0[1]}<div {6}><span class="source">{5}</span>
{0[2]}<a class="anchor" href="#{4}" name="{4}">\xb6</a> {0[2]}<a class="anchor" href="#{4}">\xb6</a>
{0[1]}</div> {0[1]}</div>
""".format( """.format(
indent, indent,
...@@ -195,13 +202,14 @@ def output_node_frame(difference, path, indentstr, indentnum, body): ...@@ -195,13 +202,14 @@ def output_node_frame(difference, path, indentstr, indentnum, body):
sizeof_fmt(difference.size()), sizeof_fmt(difference.size()),
anchor, anchor,
html.escape(difference.source1), html.escape(difference.source1),
id,
) )
else: else:
header = u"""{0[1]}<div class="{1} diffcontrol-double">{2}</div> header = u"""{0[1]}<div class="{1} diffcontrol-double">{2}</div>
{0[1]}<div><span class="diffsize">{3}</span></div> {0[1]}<div><span class="diffsize">{3}</span></div>
{0[1]}<div><span class="source">{5}</span> vs.</div> {0[1]}<div><span class="source">{5}</span> vs.</div>
{0[1]}<div><span class="source">{6}</span> {0[1]}<div {7}><span class="source">{6}</span>
{0[2]}<a class="anchor" href="#{4}" name="{4}">\xb6</a> {0[2]}<a class="anchor" href="#{4}">\xb6</a>
{0[1]}</div> {0[1]}</div>
""".format( """.format(
indent, indent,
...@@ -211,6 +219,7 @@ def output_node_frame(difference, path, indentstr, indentnum, body): ...@@ -211,6 +219,7 @@ def output_node_frame(difference, path, indentstr, indentnum, body):
anchor, anchor,
html.escape(difference.source1), html.escape(difference.source1),
html.escape(difference.source2), html.escape(difference.source2),
id,
) )
return PartialString.numl( return PartialString.numl(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment