Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/176873
Change subject: redlinks: Move contents instead of serialising/reparsing html
......................................................................
redlinks: Move contents instead of serialising/reparsing html
Follows-up b0ca6a299f.
No need to serialise the node to html, then parse it again, and
destroy the original. If there were reason to re-create the
contents, a clone() would be more appropiate, but even that's
not needed here. We can just move the contents directly.
Also:
* Fix invalid html in '<span class="new">'.
Change-Id: I9d850fba0ecb7498d684c4416f873f31556ab229
---
M javascripts/modules/redlinks/init.js
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/73/176873/1
diff --git a/javascripts/modules/redlinks/init.js
b/javascripts/modules/redlinks/init.js
index 9d42f25..f928714 100644
--- a/javascripts/modules/redlinks/init.js
+++ b/javascripts/modules/redlinks/init.js
@@ -3,8 +3,7 @@
if ( !mw.config.get( 'wgMFShowRedLinks' ) ) {
$( function () {
$( '#content a.new' ).each( function () {
- // Use html since links might contain sup or
sub elements
- $( '<span class="new">' ).html( $( this
).html() ).insertAfter( this );
+ $( '<span class="new"></span>' ).append( $(
this ).contents() ).insertAfter( this );
$( this ).remove();
} );
} );
--
To view, visit https://gerrit.wikimedia.org/r/176873
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d850fba0ecb7498d684c4416f873f31556ab229
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits