From c49e5a4308b741a8a99207a58ce635e0f11dde8d Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 21 Sep 2020 20:47:14 +0200 Subject: [PATCH] BBCodes: updated default CODE BBCode --- docs/Plugins/BBCodes/Add_from_the_repository.md | 10 +++++----- src/Bundles/Forum.php | 2 +- src/Bundles/Forum/Renderer.php | 4 ++-- src/Plugins/BBCodes/Configurator/repository.xml | 8 ++++---- tests/Bundles/data/Forum/016.html | 2 +- tests/Bundles/data/Forum/017.html | 4 ++-- tests/Bundles/data/Forum/026.html | 2 +- tests/Plugins/BBCodes/BBCodesTest.php | 8 ++++---- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/Plugins/BBCodes/Add_from_the_repository.md b/docs/Plugins/BBCodes/Add_from_the_repository.md index ce17f46e90..9dc91f2699 100644 --- a/docs/Plugins/BBCodes/Add_from_the_repository.md +++ b/docs/Plugins/BBCodes/Add_from_the_repository.md @@ -93,15 +93,15 @@ echo $html; github-gist - + - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.0/build/ + https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.1/build/ if(typeof hljsLoader!=='undefined')this.parentNode.removeChild(this) - sha384-Uf1mHO1+GzzE/kSxUZ3626n9Iq4qu1fUj03dOitZmaKCoJUBEx5u1ONu4xcwPvUM + sha384-kBP7QXPLhMrjryTXt/DbHNLhpGntUAuqLVHeBTFUAmpLKJvJt35XA4brF9DFQ1NQ hljsLoader.highlightBlocks(this.parentNode) - https://cdn.jsdelivr.net/gh/s9e/hljs-loader@1.0.13/loader.min.js + https://cdn.jsdelivr.net/gh/s9e/hljs-loader@1.0.14/loader.min.js ``` @@ -118,7 +118,7 @@ echo $html; url - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.0/build/ + https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.1/build/ highlight.js CDN URL diff --git a/src/Bundles/Forum.php b/src/Bundles/Forum.php index a88aa20b16..ed46c6522d 100644 --- a/src/Bundles/Forum.php +++ b/src/Bundles/Forum.php @@ -27,7 +27,7 @@ public static function getJS() return '(function(){function aa(a){var b=0;return function(){return bHideShowSpoilerwrote:$bB|I|LI|OL|S|TABLE|TR|U|UL|p">$h$f$bBANDCAMP"><$u$ibandcamp"$j$e400px"><$u$j$a100%"><$s$k"$n$w$lno"$j$c><$m$qsrc">//bandcamp.com/EmbeddedPlayer/size=large/minimal=true/<$y><$x$o@album_id">album=$d@album_id"/><$z$o@track_num">/t=$d@track_num"/><$t>track=$d@track_id"/>$f$bCENTER">$h$f$bCODE">
<$z$o@lang"><$m$qclass">language-$d@lang"/>$h
';break;case'COLOR':$this->out.='';$this->at($node);$this->out.='';break;case'DAILYMOTION':$this->out.='';break;case'EMAIL':$this->out.='';$this->at($node);$this->out.='';break;case'EMOJI':$this->out.=''.htmlspecialchars($node->textContent,2).'';break;case'FACEBOOK':$this->out.='';break;case'FONT':$this->out.='';$this->at($node);$this->out.='';break;case'I':$this->out.='';$this->at($node);$this->out.='';break;case'IMG':$this->out.=''.htmlspecialchars($node->getAttribute('alt'),2).'hasAttribute('height'))$this->out.=' height="'.htmlspecialchars($node->getAttribute('height'),2).'"';if($node->hasAttribute('width'))$this->out.=' width="'.htmlspecialchars($node->getAttribute('width'),2).'"';$this->out.='>';break;case'INDIEGOGO':$this->out.='';break;case'INSTAGRAM':$this->out.='';break;case'KICKSTARTER':$this->out.='hasAttribute('video'))$this->out.=' style="display:inline-block;width:100%;max-width:640px">';else$this->out.=' style="display:inline-block;width:100%;max-width:220px">';$this->out.='';break;case'LI':$this->out.='
  • ';$this->at($node);$this->out.='
  • ';break;case'LIST':if(!$node->hasAttribute('type')){$this->out.='
      ';$this->at($node);$this->out.='
    ';}elseif((strpos($node->getAttribute('type'),'decimal')===0)||(strpos($node->getAttribute('type'),'lower')===0)||(strpos($node->getAttribute('type'),'upper')===0)){$this->out.='
      hasAttribute('start'))$this->out.=' start="'.htmlspecialchars($node->getAttribute('start'),2).'"';$this->out.='>';$this->at($node);$this->out.='
    ';}else{$this->out.='
      ';$this->at($node);$this->out.='
    ';}break;case'LIVELEAK':$this->out.='';break;case'OL':$this->out.='
      ';$this->at($node);$this->out.='
    ';break;case'QUOTE':$this->out.='hasAttribute('author'))$this->out.=' class="uncited"';$this->out.='>
    ';if($node->hasAttribute('author'))$this->out.=''.htmlspecialchars($node->getAttribute('author'),0).' '.htmlspecialchars($this->params['L_WROTE'],0).'';$this->at($node);$this->out.='
    ';break;case'S':$this->out.='';$this->at($node);$this->out.='';break;case'SIZE':$this->out.='';$this->at($node);$this->out.='';break;case'SOUNDCLOUD':$this->out.='';break;case'SPOILER':$this->out.='
    '.htmlspecialchars($this->params['L_SPOILER'],0).' '.htmlspecialchars($node->getAttribute('title'),0).'
    ';break;case'TABLE':$this->out.='';$this->at($node);$this->out.='
    ';break;case'TD':$this->out.='hasAttribute('colspan'))$this->out.=' colspan="'.htmlspecialchars($node->getAttribute('colspan'),2).'"';if($node->hasAttribute('rowspan'))$this->out.=' rowspan="'.htmlspecialchars($node->getAttribute('rowspan'),2).'"';if($node->hasAttribute('align'))$this->out.=' style="text-align:'.htmlspecialchars($node->getAttribute('align'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'TH':$this->out.='hasAttribute('colspan'))$this->out.=' colspan="'.htmlspecialchars($node->getAttribute('colspan'),2).'"';if($node->hasAttribute('rowspan'))$this->out.=' rowspan="'.htmlspecialchars($node->getAttribute('rowspan'),2).'"';if($node->hasAttribute('align'))$this->out.=' style="text-align:'.htmlspecialchars($node->getAttribute('align'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'TR':$this->out.='';$this->at($node);$this->out.='';break;case'TWITCH':$this->out.='';break;case'TWITTER':$this->out.='';break;case'U':$this->out.='';$this->at($node);$this->out.='';break;case'UL':$this->out.='
      ';$this->at($node);$this->out.='
    ';break;case'URL':$this->out.='hasAttribute('title'))$this->out.=' title="'.htmlspecialchars($node->getAttribute('title'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'VIMEO':$this->out.='';break;case'VINE':$this->out.='';break;case'WSHH':$this->out.='';break;case'YOUTUBE':$this->out.='';break;case'br':$this->out.='
    ';break;case'e':case'i':case's':break;case'p':$this->out.='

    ';$this->at($node);$this->out.='

    ';break;default:$this->at($node);} + switch($node->nodeName){case'B':$this->out.='';$this->at($node);$this->out.='';break;case'BANDCAMP':$this->out.='';break;case'CENTER':$this->out.='
    ';$this->at($node);$this->out.='
    ';break;case'CODE':$this->out.='
    hasAttribute('lang'))$this->out.=' class="language-'.htmlspecialchars($node->getAttribute('lang'),2).'"';$this->out.='>';$this->at($node);$this->out.='
    ';break;case'COLOR':$this->out.='';$this->at($node);$this->out.='';break;case'DAILYMOTION':$this->out.='';break;case'EMAIL':$this->out.='';$this->at($node);$this->out.='';break;case'EMOJI':$this->out.=''.htmlspecialchars($node->textContent,2).'';break;case'FACEBOOK':$this->out.='';break;case'FONT':$this->out.='';$this->at($node);$this->out.='';break;case'I':$this->out.='';$this->at($node);$this->out.='';break;case'IMG':$this->out.=''.htmlspecialchars($node->getAttribute('alt'),2).'hasAttribute('height'))$this->out.=' height="'.htmlspecialchars($node->getAttribute('height'),2).'"';if($node->hasAttribute('width'))$this->out.=' width="'.htmlspecialchars($node->getAttribute('width'),2).'"';$this->out.='>';break;case'INDIEGOGO':$this->out.='';break;case'INSTAGRAM':$this->out.='';break;case'KICKSTARTER':$this->out.='hasAttribute('video'))$this->out.=' style="display:inline-block;width:100%;max-width:640px">';else$this->out.=' style="display:inline-block;width:100%;max-width:220px">';$this->out.='';break;case'LI':$this->out.='
  • ';$this->at($node);$this->out.='
  • ';break;case'LIST':if(!$node->hasAttribute('type')){$this->out.='
      ';$this->at($node);$this->out.='
    ';}elseif((strpos($node->getAttribute('type'),'decimal')===0)||(strpos($node->getAttribute('type'),'lower')===0)||(strpos($node->getAttribute('type'),'upper')===0)){$this->out.='
      hasAttribute('start'))$this->out.=' start="'.htmlspecialchars($node->getAttribute('start'),2).'"';$this->out.='>';$this->at($node);$this->out.='
    ';}else{$this->out.='
      ';$this->at($node);$this->out.='
    ';}break;case'LIVELEAK':$this->out.='';break;case'OL':$this->out.='
      ';$this->at($node);$this->out.='
    ';break;case'QUOTE':$this->out.='hasAttribute('author'))$this->out.=' class="uncited"';$this->out.='>
    ';if($node->hasAttribute('author'))$this->out.=''.htmlspecialchars($node->getAttribute('author'),0).' '.htmlspecialchars($this->params['L_WROTE'],0).'';$this->at($node);$this->out.='
    ';break;case'S':$this->out.='';$this->at($node);$this->out.='';break;case'SIZE':$this->out.='';$this->at($node);$this->out.='';break;case'SOUNDCLOUD':$this->out.='';break;case'SPOILER':$this->out.='
    '.htmlspecialchars($this->params['L_SPOILER'],0).' '.htmlspecialchars($node->getAttribute('title'),0).'
    ';break;case'TABLE':$this->out.='';$this->at($node);$this->out.='
    ';break;case'TD':$this->out.='hasAttribute('colspan'))$this->out.=' colspan="'.htmlspecialchars($node->getAttribute('colspan'),2).'"';if($node->hasAttribute('rowspan'))$this->out.=' rowspan="'.htmlspecialchars($node->getAttribute('rowspan'),2).'"';if($node->hasAttribute('align'))$this->out.=' style="text-align:'.htmlspecialchars($node->getAttribute('align'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'TH':$this->out.='hasAttribute('colspan'))$this->out.=' colspan="'.htmlspecialchars($node->getAttribute('colspan'),2).'"';if($node->hasAttribute('rowspan'))$this->out.=' rowspan="'.htmlspecialchars($node->getAttribute('rowspan'),2).'"';if($node->hasAttribute('align'))$this->out.=' style="text-align:'.htmlspecialchars($node->getAttribute('align'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'TR':$this->out.='';$this->at($node);$this->out.='';break;case'TWITCH':$this->out.='';break;case'TWITTER':$this->out.='';break;case'U':$this->out.='';$this->at($node);$this->out.='';break;case'UL':$this->out.='
      ';$this->at($node);$this->out.='
    ';break;case'URL':$this->out.='hasAttribute('title'))$this->out.=' title="'.htmlspecialchars($node->getAttribute('title'),2).'"';$this->out.='>';$this->at($node);$this->out.='';break;case'VIMEO':$this->out.='';break;case'VINE':$this->out.='';break;case'WSHH':$this->out.='';break;case'YOUTUBE':$this->out.='';break;case'br':$this->out.='
    ';break;case'e':case'i':case's':break;case'p':$this->out.='

    ';$this->at($node);$this->out.='

    ';break;default:$this->at($node);} } /** {@inheritdoc} */ public $enableQuickRenderer=true; /** {@inheritdoc} */ - protected $static=['/B'=>'','/CENTER'=>'','/CODE'=>'','/COLOR'=>'','/EMAIL'=>'','/FONT'=>'','/I'=>'','/LI'=>'','/OL'=>'','/QUOTE'=>'','/S'=>'','/SIZE'=>'','/SPOILER'=>'','/TABLE'=>'','/TD'=>'','/TH'=>'','/TR'=>'','/U'=>'','/UL'=>'','/URL'=>'','B'=>'','CENTER'=>'
    ','I'=>'','LI'=>'
  • ','OL'=>'
      ','S'=>'','TABLE'=>'','TR'=>'','U'=>'','UL'=>'
        ']; + protected $static=['/B'=>'','/CENTER'=>'','/CODE'=>'','/COLOR'=>'','/EMAIL'=>'','/FONT'=>'','/I'=>'','/LI'=>'','/OL'=>'','/QUOTE'=>'','/S'=>'','/SIZE'=>'','/SPOILER'=>'','/TABLE'=>'
      ','/TD'=>'','/TH'=>'','/TR'=>'','/U'=>'','/UL'=>'','/URL'=>'','B'=>'','CENTER'=>'
      ','I'=>'','LI'=>'
    1. ','OL'=>'
        ','S'=>'','TABLE'=>'','TR'=>'','U'=>'','UL'=>'