Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/193162
Change subject: Handle examples as raw html on Special:ApiSandbox
......................................................................
Handle examples as raw html on Special:ApiSandbox
helpformat is html, that includes examples, but the examples was not
adding as raw html to the dom which gives escaped html like <kbd>.
Bug: T84995
Change-Id: I23a7918066dfc5610d23f737fbbb760be6359b1a
---
M resources/main.js
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiSandbox
refs/changes/62/193162/1
diff --git a/resources/main.js b/resources/main.js
index 0ee1ab3..5f97dd9 100644
--- a/resources/main.js
+++ b/resources/main.js
@@ -321,17 +321,17 @@
count = 0;
for ( i = 0; i < actionInfo.examples.length; i++ ) {
href = actionInfo.examples[i].query;
- text = actionInfo.examples[i].description !==
'' ? actionInfo.examples[i].description : href;
- prefix = text.replace( /[^\n]*$/, '' );
+ html = actionInfo.examples[i].description !==
'' ? actionInfo.examples[i].description : href;
+ prefix = html.replace( /[^\n]*$/, '' );
$prefix = prefix.length ? $( '<b>' ).text(
prefix ) : [];
- linkText = text.replace( /^.*\n/, '' );
+ linkHtml = html.replace( /^.*\n/, '' );
$( '<li>' )
.append( $prefix )
.append(
$( '<a>' )
.attr( 'href', '#' )
.data( 'exampleLink',
href )
- .text( linkText )
+ .html( linkHtml )
.click( exampleClick )
).appendTo( $list );
count++;
--
To view, visit https://gerrit.wikimedia.org/r/193162
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I23a7918066dfc5610d23f737fbbb760be6359b1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApiSandbox
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits