original_string: protected function blockFencedCode($line)
      {
          $regex = '/^([' . $line[ 'text' ][ 0 ] . ']{3,})[ ]*([\w-]+)?[ ]*$/';
  
          if (preg_match($regex, $line[ 'text' ], $matches)) {
              $element = [
                  'name' => 'code',
                  'text' => '',
              ];
  
              if (isset($matches[ 2 ])) {
                  $class = $this->getConfig('fenced_code_lang_class', 'prettyprint lang-{LANG}');
                  $class = str_replace('{LANG}', $matches[2], $class); //'prettyprint lang-' . $matches[ 2 ];
  
                  $element[ 'attributes' ] = [ 'class' => $class ];
              }
  
              $block = [
                  'char'    => $line[ 'text' ][ 0 ],
                  'element' => [
                      'name'    => 'pre',
                      'handler' => 'element',
                      'text'    => $element,
                  ],
              ];
  
              return $block;
          }
      }
code: protected function blockFencedCode($line)
      {
          $regex = '/^([' . $line[ 'text' ][ 0 ] . ']{3,})[ ]*([\w-]+)?[ ]*$/';
  
          if (preg_match($regex, $line[ 'text' ], $matches)) {
              $element = [
                  'name' => 'code',
                  'text' => '',
              ];
  
              if (isset($matches[ 2 ])) {
                  $class = $this->getConfig('fenced_code_lang_class', 'prettyprint lang-{LANG}');
                  $class = str_replace('{LANG}', $matches[2], $class); //'prettyprint lang-' . $matches[ 2 ];
  
                  $element[ 'attributes' ] = [ 'class' => $class ];
              }
  
              $block = [
                  'char'    => $line[ 'text' ][ 0 ],
                  'element' => [
                      'name'    => 'pre',
                      'handler' => 'element',
                      'text'    => $element,
                  ],
              ];
  
              return $block;
          }
      }
code_tokens: protected function blockFencedCode ( $ line ) { $ regex = '/^([' . $ line [ 'text' ] [ 0 ] . ']{3,})[ ]*([\w-]+)?[ ]*$/' ; if ( preg_match ( $ regex , $ line [ 'text' ] , $ matches ) ) { $ element = [ 'name' => 'code' , 'text' => '' , ] ; if ( isset ( $ matches [ 2 ] ) ) { $ class = $ this -> getConfig ( 'fenced_code_lang_class' , 'prettyprint lang-{LANG}' ) ; $ class = str_replace ( '{LANG}' , $ matches [ 2 ] , $ class ) ; //'prettyprint lang-' . $matches[ 2 ]; $ element [ 'attributes' ] = [ 'class' => $ class ] ; } $ block = [ 'char' => $ line [ 'text' ] [ 0 ] , 'element' => [ 'name' => 'pre' , 'handler' => 'element' , 'text' => $ element , ] , ] ; return $ block ; } }
docstring: Parse fenced code blocks.
  
  @param array $line
  @return array
docstring_tokens: Parse fenced code blocks .