From 75def22e57b9face07cd0be1060923d6aca88129 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Wed, 9 Jul 2014 15:19:32 +0200 Subject: [PATCH] W3C module: handle document wide messages --- modules/networking.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/networking.py b/modules/networking.py index 4015ed2..98f1d16 100644 --- a/modules/networking.py +++ b/modules/networking.py @@ -287,6 +287,9 @@ def cmd_w3c(msg): res.append_message("%s: status: %s, %s warning(s), %s error(s)" % (validator["url"], headers["X-W3C-Validator-Status"], headers["X-W3C-Validator-Warnings"], headers["X-W3C-Validator-Errors"])) for m in validator["messages"]: - res.append_message("%s%s on line %s, col %s: %s" % (m["type"][0].upper(), m["type"][1:], m["lastLine"], m["lastColumn"], m["message"])) + if "lastLine" not in m: + res.append_message("%s%s: %s" % (m["type"][0].upper(), m["type"][1:], m["message"])) + else: + res.append_message("%s%s on line %s, col %s: %s" % (m["type"][0].upper(), m["type"][1:], m["lastLine"], m["lastColumn"], m["message"])) return res