Skip to contentSkip to conversation

test/py: fix anchors in HTML status report

PATCH In review Stephen Warren 2 participants 2 messages Sep 18, 2017 – Sep 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/py: fix anchors in HTML status report

From: Stephen Warren <[email protected]>

The current code wraps a pre tag inside an a tag. For some reason, this causes at least Firefox to attempt to drag the pre section content when using a mouse drag to select text. Re-order the tags so that the text can be selected using the mouse, at least if you start the drag outside the text (after the end of the line, for example).

---
 test/py/multiplexed_log.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
test/py/multiplexed_log.py +4 -4
index bf926c3e7762..5bc1bc49d4de 100644
@@ -365,13 +365,13 @@ $(document).ready(function () {
 
         self._terminate_stream()
         self.f.write('<div class="' + note_type + '">\n')
-        if anchor:
-            self.f.write('<a href="#%s">\n' % anchor)
         self.f.write('<pre>')
+        if anchor:
+            self.f.write('<a href="#%s">' % anchor)
         self.f.write(self._escape(msg))
-        self.f.write('\n</pre>\n')
         if anchor:
-            self.f.write('</a>\n')
+            self.f.write('</a>')
+        self.f.write('\n</pre>\n')
         self.f.write('</div>\n')
 
     def start_section(self, marker, anchor=None):
Signature · 1 line
2.14.1
#1 lore raw
Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

The current code wraps a pre tag inside an a tag. For some reason, this causes at least Firefox to attempt to drag the pre section content when using a mouse drag to select text. Re-order the tags so that the text can be selected using the mouse, at least if you start the drag outside the text (after the end of the line, for example).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/d1e437cc/attachment.sig>