Improve comment and general data-* attribute normalization.

This commit is contained in:
Gabriel Wicke 2011-11-28 16:55:50 +00:00
parent b16c295b98
commit d7537d9777

View file

@ -156,7 +156,8 @@ function normalizeHTML(source) {
// known-ok differences. // known-ok differences.
function normalizeOut ( out ) { function normalizeOut ( out ) {
// TODO: Do not strip newlines in pre and nowiki blocks! // TODO: Do not strip newlines in pre and nowiki blocks!
return out.replace(/\n| data-sourcePos="[^>]+"|<!--[^-]*-->\n?/g, ''); return out.replace(/\n| data-[a-zA-Z]+="[^">]+"/g, '')
.replace(/<!--.*?-->\n?/gm, '');
} }
function formatHTML ( source ) { function formatHTML ( source ) {