File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ FeedParser.prototype.handleCloseTag = function (el){
213213 , stdEl
214214 , item
215215 , baseurl
216+ , isIllegallyNested = false
216217 ;
217218 var n = this . stack . shift ( ) ;
218219 el = el . split ( ':' ) ;
@@ -297,6 +298,17 @@ FeedParser.prototype.handleCloseTag = function (el){
297298 ( node [ '#local' ] === 'item' && ( node [ '#prefix' ] === '' || node [ '#type' ] === 'rdf' ) ) ||
298299 ( node [ '#local' ] == 'entry' && ( node [ '#prefix' ] === '' || node [ '#type' ] === 'atom' ) ) ) { // We have an article!
299300
301+ isIllegallyNested = (
302+ ( node [ '#name' ] === 'item' && this . stack [ 0 ] [ '#name' ] === 'item' ) ||
303+ ( node [ '#name' ] === 'entry' && this . stack [ 0 ] [ '#name' ] === 'entry' ) ||
304+ ( ( node [ '#local' ] === 'item' && ( node [ '#prefix' ] === '' || node [ '#type' ] === 'rdf' ) ) && this . stack [ 0 ] [ '#name' ] === 'item' ) ||
305+ ( ( node [ '#local' ] == 'entry' && ( node [ '#prefix' ] === '' || node [ '#type' ] === 'atom' ) ) && this . stack [ 0 ] [ '#name' ] === 'entry' )
306+ ) ;
307+
308+ if ( isIllegallyNested ) {
309+ return ;
310+ }
311+
300312 if ( ! this . meta . title ) { // We haven't yet parsed all the metadata
301313 _ . assign ( this . meta , this . handleMeta ( this . stack [ 0 ] , this . meta [ '#type' ] , this . options ) ) ;
302314 if ( ! this . _emitted_meta ) {
You can’t perform that action at this time.
0 commit comments