@@ -256,9 +256,9 @@ protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $
256
256
$ attributes = array ();
257
257
$ id = false ;
258
258
foreach ($ elements as $ element ) {
259
- if ($ element{ 0 } === '. ' ) {
259
+ if ($ element[ 0 ] === '. ' ) {
260
260
$ classes [] = substr ($ element , 1 );
261
- } else if ($ element{ 0 } === '# ' ) {
261
+ } else if ($ element[ 0 ] === '# ' ) {
262
262
if ($ id === false ) $ id = substr ($ element , 1 );
263
263
} else if (strpos ($ element , '= ' ) > 0 ) {
264
264
$ parts = explode ('= ' , $ element , 2 );
@@ -553,14 +553,14 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
553
553
}
554
554
}
555
555
// Check for: Indented code block.
556
- else if ($ tag{ 0 } === "\n" || $ tag{ 0 } === " ") {
556
+ else if ($ tag[ 0 ] === "\n" || $ tag[ 0 ] === " " ) {
557
557
// Indented code block: pass it unchanged, will be handled
558
558
// later.
559
559
$ parsed .= $ tag ;
560
560
}
561
561
// Check for: Code span marker
562
562
// Note: need to check this after backtick fenced code blocks
563
- else if ( $ tag{0} === "`") {
563
+ else if ($ tag[ 0 ] === "` " ) {
564
564
// Find corresponding end marker.
565
565
$ tag_re = preg_quote ($ tag );
566
566
if (preg_match ('{^(?>.+?|\n(?!\n))*?(?<!`) ' . $ tag_re . '(?!`)} ' ,
@@ -594,7 +594,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
594
594
// Check for: Clean tag (like script, math)
595
595
// HTML Comments, processing instructions.
596
596
else if (preg_match ('{^<(?: ' . $ this ->clean_tags_re . ')\b} ' , $ tag ) ||
597
- $ tag{ 1 } === '! ' || $ tag{ 1 } === '? ' )
597
+ $ tag[ 1 ] === '! ' || $ tag[ 1 ] === '? ' )
598
598
{
599
599
// Need to parse tag and following text using the HTML parser.
600
600
// (don't check for markdown attribute)
@@ -609,7 +609,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
609
609
preg_match ('{^</?(?: ' . $ enclosing_tag_re . ')\b} ' , $ tag ))
610
610
{
611
611
// Increase/decrease nested tag count.
612
- if ($ tag{ 1 } === '/ ' ) {
612
+ if ($ tag[ 1 ] === '/ ' ) {
613
613
$ depth --;
614
614
} else if ($ tag {strlen ($ tag )-2 } !== '/ ' ) {
615
615
$ depth ++;
@@ -713,7 +713,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
713
713
// In that case, we return original text unchanged and pass the
714
714
// first character as filtered to prevent an infinite loop in the
715
715
// parent function.
716
- return array ($ original_text{ 0 } , substr ($ original_text , 1 ));
716
+ return array ($ original_text[ 0 ] , substr ($ original_text , 1 ));
717
717
}
718
718
719
719
$ block_text .= $ parts [0 ]; // Text before current tag.
@@ -723,7 +723,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
723
723
// Check for: Auto-close tag (like <hr/>)
724
724
// Comments and Processing Instructions.
725
725
if (preg_match ('{^</?(?: ' . $ this ->auto_close_tags_re . ')\b} ' , $ tag ) ||
726
- $ tag{ 1 } === '! ' || $ tag{ 1 } === '? ' )
726
+ $ tag[ 1 ] === '! ' || $ tag[ 1 ] === '? ' )
727
727
{
728
728
// Just add the tag to the block as if it was text.
729
729
$ block_text .= $ tag ;
@@ -732,7 +732,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
732
732
// Increase/decrease nested tag count. Only do so if
733
733
// the tag's name match base tag's.
734
734
if (preg_match ('{^</? ' . $ base_tag_name_re . '\b} ' , $ tag )) {
735
- if ($ tag{ 1 } === '/ ' ) {
735
+ if ($ tag[ 1 ] === '/ ' ) {
736
736
$ depth --;
737
737
} else if ($ tag {strlen ($ tag )-2 } !== '/ ' ) {
738
738
$ depth ++;
@@ -1125,7 +1125,7 @@ protected function _doHeaders_callback_setext($matches) {
1125
1125
return $ matches [0 ];
1126
1126
}
1127
1127
1128
- $ level = $ matches [3 ]{ 0 } === '= ' ? 1 : 2 ;
1128
+ $ level = $ matches [3 ][ 0 ] === '= ' ? 1 : 2 ;
1129
1129
1130
1130
$ defaultId = is_callable ($ this ->header_id_func ) ? call_user_func ($ this ->header_id_func , $ matches [1 ]) : null ;
1131
1131
@@ -1519,7 +1519,7 @@ protected function _doFencedCodeBlocks_callback($matches) {
1519
1519
1520
1520
$ classes = array ();
1521
1521
if ($ classname !== "" ) {
1522
- if ($ classname{ 0 } === '. ' ) {
1522
+ if ($ classname[ 0 ] === '. ' ) {
1523
1523
$ classname = substr ($ classname , 1 );
1524
1524
}
1525
1525
$ classes [] = $ this ->code_class_prefix . $ classname ;
0 commit comments