Platinum Partner

ToStandard //JavaScript Function

This function tries to parse bad html and transform into xhtml, by lower-casing the tags, properties and duplicating single properties (readonly becomes readonly="readonly"), my function is very generic.

example:

s = 'blabla
'; prompt("", toStandard(s));
code: //+ Jonas Raoni Soares Silva //@ http://jsfromhell.com function toStandard(s){ return s.replace(/<(\/?\w+)([^>]*)>/g, function(s, t, c, d){ return "<" + t.toLowerCase() + c.replace(/\b(\w+)(?:=((?:(?=(["'])).((?!\3)(?:.|\n))*\3)|\S*))?/g, function(s, p, v, a){ return (p = p.toLowerCase()) + "=" + (a = a ? "" : '"') + (v || p) + a; }) + ">"; }); };
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}