hugoschuil / namebench

Automatically exported from code.google.com/p/namebench
Apache License 2.0
0 stars 0 forks source link

W3C invalid HTML #224

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the program as normal and allow the html report to output.
2. Validate the html report with the W3C at http://validator.w3.org/

What is the expected output? What do you see instead?
Error free (and possibly warning free).  Instead I see 90 errors and 86 
warnings.

What version of the product are you using? On what operating system?
Namebench 1.3.1 stable on Kubuntu 12.04 (KDE version of Ubuntu).

Please provide any additional information below.
I have created a patch with fixes many errors and some warnings (still a work 
in progress).  See my attached patch file.

You can run the patch against the stable namebench 1.3.1 source with the 
following command.

patch -p1 < namebench-1.3.1.patch

I will continue working on this and submitting more patches until the generated 
output is W3C compliant.

Original issue reported on code.google.com by sam.mxra...@gmail.com on 26 Sep 2012 at 5:38

Attachments:

GoogleCodeExporter commented 8 years ago
Most of the errors are due to open <a> tags, improper URL encoding (e.g. " and 
? rather than %22 and %3F respectively), and not replacing special characters 
with html valid markup (e.g. & instead of & even in URLs).

Original comment by sam.mxra...@gmail.com on 26 Sep 2012 at 5:41

GoogleCodeExporter commented 8 years ago
Final patch.  Fixed all remaining errors and warnings.  Added an encoding meta 
tag.

In libnamebench/charts.py line 118 was not working,
chart.display.enhanced_encoding = True

So I removed it and had to call it as an argument return like line 124
return chart.display.Url(CHART_WIDTH, _BarGraphHeight(bar_count), True)

I figured that out by viewing the source of 
nb_third_party/graphy/backends/google_chart_api/encoders.py
where the charts.display.Url() function is defined as:
def Url(self, width, height, use_html_entities=False):

namebench reports are now Valid W3C html.

Once again to patch the software from within the namebench-1.3.1 stable folder.

patch -p1 < namebench-1.3.1r2.patch

Original comment by sam.mxra...@gmail.com on 26 Sep 2012 at 6:30

Attachments: