jenkins-bot has submitted this change and it was merged.

Change subject: Use different method of importing HTML into DOM, so it doesn't 
mess up data
......................................................................


Use different method of importing HTML into DOM, so it doesn't mess up data

Change-Id: I585b929375a1a0d41c7bad1f341c3653c3b93bca
---
M wikibase/queryService/api/QuerySamples.js
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wikibase/queryService/api/QuerySamples.js 
b/wikibase/queryService/api/QuerySamples.js
index 6031044..a001979 100644
--- a/wikibase/queryService/api/QuerySamples.js
+++ b/wikibase/queryService/api/QuerySamples.js
@@ -87,9 +87,12 @@
        };
 
        SELF.prototype._parseHTML = function ( html ) {
-               var data = $( '<div/>' ).append( html ),
+               var div = document.createElement( 'div' ),
+                       data,
                        self = this;
-               // Find all SPARQL Templates
+               div.innerHTML = html;
+               data = $( div );
+                       // Find all SPARQL Templates
                var examples = data.find( 'div.mw-highlight' ).map( function() {
                        var dataMW = $( this ).attr( 'data-mw' );
                        if ( !dataMW ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/306279
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I585b929375a1a0d41c7bad1f341c3653c3b93bca
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to