Merge "Make the full document regex hack a bit more robust"

This commit is contained in:
jenkins-bot 2013-02-22 23:26:38 +00:00 committed by Gerrit Code Review
commit 065e9c8a67

View file

@ -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 = '<!doctype html><html><head></head><body>' + data.content + '</body></html>';