@@ -156,9 +156,9 @@ protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null) {
156156 $ attributes = array ();
157157 $ id = false ;
158158 foreach ($ elements as $ element ) {
159- if ($ element{ 0 } == '. ' ) {
159+ if ($ element[ 0 ] == '. ' ) {
160160 $ classes [] = substr ($ element , 1 );
161- } else if ($ element{ 0 } == '# ' ) {
161+ } else if ($ element[ 0 ] == '# ' ) {
162162 if ($ id === false ) $ id = substr ($ element , 1 );
163163 } else if (strpos ($ element , '= ' ) > 0 ) {
164164 $ parts = explode ('= ' , $ element , 2 );
@@ -429,7 +429,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
429429 #
430430 # Check for: Indented code block.
431431 #
432- else if ($ tag{ 0 } == "\n" || $ tag{ 0 } == " ") {
432+ else if ($ tag[ 0 ] == "\n" || $ tag[ 0 ] == " " ) {
433433 # Indented code block: pass it unchanged, will be handled
434434 # later.
435435 $ parsed .= $ tag ;
@@ -438,7 +438,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
438438 # Check for: Code span marker
439439 # Note: need to check this after backtick fenced code blocks
440440 #
441- else if ( $ tag{0} == "`") {
441+ else if ($ tag[ 0 ] == "` " ) {
442442 # Find corresponding end marker.
443443 $ tag_re = preg_quote ($ tag );
444444 if (preg_match ('{^(?>.+?|\n(?!\n))*?(?<!`) ' .$ tag_re .'(?!`)} ' ,
@@ -476,7 +476,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
476476 # HTML Comments, processing instructions.
477477 #
478478 else if (preg_match ('{^<(?: ' .$ this ->clean_tags_re .')\b} ' , $ tag ) ||
479- $ tag{ 1 } == '! ' || $ tag{ 1 } == '? ' )
479+ $ tag[ 1 ] == '! ' || $ tag[ 1 ] == '? ' )
480480 {
481481 # Need to parse tag and following text using the HTML parser.
482482 # (don't check for markdown attribute)
@@ -495,8 +495,8 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
495495 #
496496 # Increase/decrease nested tag count.
497497 #
498- if ($ tag{ 1 } == '/ ' ) $ depth --;
499- else if ($ tag{ strlen ($ tag )-2 } != '/ ' ) $ depth ++;
498+ if ($ tag[ 1 ] == '/ ' ) $ depth --;
499+ else if ($ tag[ strlen ($ tag )-2 ] != '/ ' ) $ depth ++;
500500
501501 if ($ depth < 0 ) {
502502 #
@@ -600,7 +600,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
600600 # first character as filtered to prevent an infinite loop in the
601601 # parent function.
602602 #
603- return array ($ original_text{ 0 } , substr ($ original_text , 1 ));
603+ return array ($ original_text[ 0 ] , substr ($ original_text , 1 ));
604604 }
605605
606606 $ block_text .= $ parts [0 ]; # Text before current tag.
@@ -612,7 +612,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
612612 # Comments and Processing Instructions.
613613 #
614614 if (preg_match ('{^</?(?: ' .$ this ->auto_close_tags_re .')\b} ' , $ tag ) ||
615- $ tag{ 1 } == '! ' || $ tag{ 1 } == '? ' )
615+ $ tag[ 1 ] == '! ' || $ tag[ 1 ] == '? ' )
616616 {
617617 # Just add the tag to the block as if it was text.
618618 $ block_text .= $ tag ;
@@ -623,8 +623,8 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
623623 # the tag's name match base tag's.
624624 #
625625 if (preg_match ('{^</? ' .$ base_tag_name_re .'\b} ' , $ tag )) {
626- if ($ tag{ 1 } == '/ ' ) $ depth --;
627- else if ($ tag{ strlen ($ tag )-2 } != '/ ' ) $ depth ++;
626+ if ($ tag[ 1 ] == '/ ' ) $ depth --;
627+ else if ($ tag[ strlen ($ tag )-2 ] != '/ ' ) $ depth ++;
628628 }
629629
630630 #
@@ -988,7 +988,7 @@ protected function _doHeaders_callback_setext($matches) {
988988 if ($ matches [3 ] == '- ' && preg_match ('{^- } ' , $ matches [1 ]))
989989 return $ matches [0 ];
990990
991- $ level = $ matches [3 ]{ 0 } == '= ' ? 1 : 2 ;
991+ $ level = $ matches [3 ][ 0 ] == '= ' ? 1 : 2 ;
992992
993993 $ defaultId = is_callable ($ this ->header_id_func ) ? call_user_func ($ this ->header_id_func , $ matches [1 ]) : null ;
994994
@@ -1323,7 +1323,7 @@ protected function _doFencedCodeBlocks_callback($matches) {
13231323 array ($ this , '_doFencedCodeBlocks_newlines ' ), $ codeblock );
13241324
13251325 if ($ classname != "" ) {
1326- if ($ classname{ 0 } == '. ' )
1326+ if ($ classname[ 0 ] == '. ' )
13271327 $ classname = substr ($ classname , 1 );
13281328 $ attr_str = ' class=" ' .$ this ->code_class_prefix .$ classname .'" ' ;
13291329 } else {
0 commit comments