X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser.js;h=c2252e9d1b53d1355f9a8c0b16aca9149a99f128;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=ac1420d7454c6b9d1de2ee1e6f8bdf2f54d733b5;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_source/core/htmlparser.js b/_source/core/htmlparser.js index ac1420d..c2252e9 100644 --- a/_source/core/htmlparser.js +++ b/_source/core/htmlparser.js @@ -4,9 +4,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ /** - * HTML text parser. - * @constructor + * Creates a {@link CKEDITOR.htmlParser} class instance. + * @class Provides an "event like" system to parse strings of HTML data. * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onTagOpen = function( tagName, attributes, selfClosing ) + * { + * alert( tagName ); + * }; + * parser.parse( '<p>Some <b>text</b>.</p>' ); */ CKEDITOR.htmlParser = function() { @@ -92,7 +98,7 @@ CKEDITOR.htmlParser = function() * @param {String} comment The comment text. * @example * var parser = new CKEDITOR.htmlParser(); - * parser.onText = function( comment ) + * parser.onComment = function( comment ) * { * alert( comment ); // e.g. " Example " * }); @@ -172,6 +178,12 @@ CKEDITOR.htmlParser = function() if ( ( tagName = parts[ 3 ] ) ) { tagName = tagName.toLowerCase(); + + // There are some tag names that can break things, so let's + // simply ignore them when parsing. (#5224) + if ( /="/.test( tagName ) ) + continue; + var attribs = {}, attribMatch, attribsPart = parts[ 4 ],