From 4b086b94d7b25987fb2eb3dfbb6173025c3373a0 Mon Sep 17 00:00:00 2001 From: Catrope Date: Thu, 21 Feb 2013 14:59:19 -0800 Subject: [PATCH] Make the full document regex hack a bit more robust Anchor the regex and make it look for doctype too Change-Id: I43abb6f214a28801642bde46b50f4ac12614d1e4 --- modules/ve/init/mw/ve.init.mw.Target.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve/init/mw/ve.init.mw.Target.js b/modules/ve/init/mw/ve.init.mw.Target.js index 0f941b410b..b9fb408264 100644 --- a/modules/ve/init/mw/ve.init.mw.Target.js +++ b/modules/ve/init/mw/ve.init.mw.Target.js @@ -104,7 +104,7 @@ ve.init.mw.Target.onLoad = function ( response ) { } else { // HACK for backwards compatibility with older versions of Parsoid, detect whether // data.content is a document fragment or a full HTML document - if ( data.content.match( /<(html|head|body)(>|\s)/ ) ) { + if ( data.content.match( /^<(!doctype|html|head|body)(>|\s)/ ) ) { html = data.content; } else { html = '' + data.content + '';