mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Add mw-content-ltr/rtl classes to inline snippets
We already add the dir=ltr/rtl HTML attribute so this should be a no-op and makes it consistent with block snippets. Change-Id: I53e9204cc3bd54ba167f6f91e718a9d35b5bdfd0
This commit is contained in:
parent
4df77c1138
commit
2d3af74c39
|
@ -393,9 +393,7 @@ class SyntaxHighlight {
|
|||
if ( $lexer !== null ) {
|
||||
$classList[] = self::HIGHLIGHT_CSS_CLASS . '-lang-' . $lexer;
|
||||
}
|
||||
if ( !$isInline ) {
|
||||
$classList[] = 'mw-content-' . $dir;
|
||||
}
|
||||
$classList[] = 'mw-content-' . $dir;
|
||||
if ( $showLines ) {
|
||||
$classList[] = self::HIGHLIGHT_CSS_CLASS . '-lines';
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ SRC=javascript:al
|
|||
%253cscript%253ealert(document.cookie)%253c/script%253e
|
||||
</source>
|
||||
!! html
|
||||
<p><code class="mw-highlight" dir="ltr"><script>alert("pwnd")</script> <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`> <IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40; &#39;&#88;&#83;&#83;&#39;&#41; \";alert('XSS');// </script><script>alert('XSS');</script> %253cscript%253ealert(document.cookie)%253c/script%253e</code>
|
||||
<p><code class="mw-highlight mw-content-ltr" dir="ltr"><script>alert("pwnd")</script> <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`> <IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40; &#39;&#88;&#83;&#83;&#39;&#41; \";alert('XSS');// </script><script>alert('XSS');</script> %253cscript%253ealert(document.cookie)%253c/script%253e</code>
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
@ -122,7 +122,7 @@ Inline attribute (inline code)
|
|||
!! wikitext
|
||||
Text <source lang="javascript" inline>var a;</source>.
|
||||
!! html
|
||||
<p>Text <code class="mw-highlight mw-highlight-lang-javascript" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
|
||||
<p>Text <code class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
@ -131,7 +131,7 @@ Enclose none (inline code)
|
|||
!! wikitext
|
||||
Text <source lang="javascript" enclose="none">var a;</source>.
|
||||
!! html
|
||||
<p>Text <code class="mw-highlight mw-highlight-lang-javascript" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
|
||||
<p>Text <code class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
@ -140,7 +140,7 @@ Enclose with nowiki
|
|||
!! wikitext
|
||||
{{#tag:syntaxhighlight|<nowiki>foo</nowiki>|lang="text"|inline=none}}
|
||||
!! html
|
||||
<p><code class="mw-highlight mw-highlight-lang-text" dir="ltr">foo</code>
|
||||
<p><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" dir="ltr">foo</code>
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
|
Loading…
Reference in a new issue