Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.6.3
[ckeditor.git]
/
_source
/
core
/
htmlparser.js
diff --git
a/_source/core/htmlparser.js
b/_source/core/htmlparser.js
index
748887e
..
b652c6f
100644
(file)
--- a/
_source/core/htmlparser.js
+++ b/
_source/core/htmlparser.js
@@
-1,18
+1,24
@@
/*
\r
/*
\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
/**
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
/**
\r
- * HTML text parser.
\r
- * @constructor
\r
+ * Creates a {@link CKEDITOR.htmlParser} class instance.
\r
+ * @class Provides an "event like" system to parse strings of HTML data.
\r
* @example
\r
* @example
\r
+ * var parser = new CKEDITOR.htmlParser();
\r
+ * parser.onTagOpen = function( tagName, attributes, selfClosing )
\r
+ * {
\r
+ * alert( tagName );
\r
+ * };
\r
+ * parser.parse( '<p>Some <b>text</b>.</p>' );
\r
*/
\r
CKEDITOR.htmlParser = function()
\r
{
\r
this._ =
\r
{
\r
*/
\r
CKEDITOR.htmlParser = function()
\r
{
\r
this._ =
\r
{
\r
- htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^"\'>]+)|(?:"[^"]*")|(?:\'[^\']*\'))*)\\/?>))', 'g' )
\r
+ htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:"[^"]*")|(?:\'[^\']*\')|[^"\'>])*)\\/?>))', 'g' )
\r
};
\r
};
\r
\r
};
\r
};
\r
\r
@@
-92,7
+98,7
@@
CKEDITOR.htmlParser = function()
* @param {String} comment The comment text.
\r
* @example
\r
* var parser = new CKEDITOR.htmlParser();
\r
* @param {String} comment The comment text.
\r
* @example
\r
* var parser = new CKEDITOR.htmlParser();
\r
- * parser.onText = function( comment )
\r
+ * parser.onComment = function( comment )
\r
* {
\r
* alert( comment ); // e.g. " Example "
\r
* });
\r
* {
\r
* alert( comment ); // e.g. " Example "
\r
* });
\r
@@
-172,6
+178,12
@@
CKEDITOR.htmlParser = function()
if ( ( tagName = parts[ 3 ] ) )
\r
{
\r
tagName = tagName.toLowerCase();
\r
if ( ( tagName = parts[ 3 ] ) )
\r
{
\r
tagName = tagName.toLowerCase();
\r
+
\r
+ // There are some tag names that can break things, so let's
\r
+ // simply ignore them when parsing. (#5224)
\r
+ if ( /="/.test( tagName ) )
\r
+ continue;
\r
+
\r
var attribs = {},
\r
attribMatch,
\r
attribsPart = parts[ 4 ],
\r
var attribs = {},
\r
attribMatch,
\r
attribsPart = parts[ 4 ],
\r
@@
-201,7
+213,7
@@
CKEDITOR.htmlParser = function()
}
\r
\r
// Comment
\r
}
\r
\r
// Comment
\r
- if( ( tagName = parts[ 2 ] ) )
\r
+ if ( ( tagName = parts[ 2 ] ) )
\r
this.onComment( tagName );
\r
}
\r
\r
this.onComment( tagName );
\r
}
\r
\r