mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
i18n: write code ltr even for rtl languages #492
This commit is contained in:
parent
c0a1c9cbcb
commit
27bb276909
2 changed files with 5 additions and 6 deletions
|
@ -548,10 +548,11 @@ pre {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
pre.pre-code,
|
||||
pre:has( code ){
|
||||
/* the :has() operator isn't available in FF yet, so we patch this by JS */
|
||||
/* pre:has( code ), */
|
||||
/* the :has() operator isn't available in FF yet, so we patch this by JS */
|
||||
pre.pre-code {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
pre code {
|
||||
|
|
|
@ -368,13 +368,11 @@ function initCodeClipboard(){
|
|||
|
||||
clip.on( 'success', function( e ){
|
||||
e.clearSelection();
|
||||
var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre';
|
||||
e.trigger.setAttribute( 'aria-label', window.T_Copied_to_clipboard );
|
||||
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
||||
});
|
||||
|
||||
clip.on( 'error', function( e ){
|
||||
var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre';
|
||||
e.trigger.setAttribute( 'aria-label', fallbackMessage(e.action) );
|
||||
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
||||
var f = function(){
|
||||
|
@ -388,7 +386,7 @@ function initCodeClipboard(){
|
|||
code.classList.add( 'copy-to-clipboard-code' );
|
||||
if( inPre ){
|
||||
code.classList.add( 'copy-to-clipboard' );
|
||||
code.classList.add( 'pre-code' );
|
||||
code.parentNode.classList.add( 'pre-code' );
|
||||
}
|
||||
else{
|
||||
var clone = code.cloneNode( true );
|
||||
|
|
Loading…
Reference in a new issue