@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | // Try to take parser from the static parser list |
37 | 37 | static $parser_list; |
38 | - $parser =& $parser_list[$parser_class]; |
|
38 | + $parser = & $parser_list[$parser_class]; |
|
39 | 39 | |
40 | 40 | // Create the parser it not already set |
41 | 41 | if (!$parser) { |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | $this->prepareItalicsAndBold(); |
158 | 158 | |
159 | 159 | $this->nested_brackets_re = |
160 | - str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). |
|
160 | + str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth) . |
|
161 | 161 | str_repeat('\])*', $this->nested_brackets_depth); |
162 | 162 | |
163 | 163 | $this->nested_url_parenthesis_re = |
164 | - str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). |
|
164 | + str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth) . |
|
165 | 165 | str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); |
166 | 166 | |
167 | 167 | // Test change |
168 | - $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; |
|
168 | + $this->escape_chars_re = '[' . preg_quote($this->escape_chars) . ']'; |
|
169 | 169 | |
170 | 170 | // Sort document, block, and span gamut in ascendent priority order. |
171 | 171 | asort($this->document_gamut); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | // Link defs are in the form: ^[id]: url "optional title" |
286 | 286 | $text = preg_replace_callback('{ |
287 | - ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 |
|
287 | + ^[ ]{0,'.$less_than_tab . '}\[(.+)\][ ]?: # id = $1 |
|
288 | 288 | [ ]* |
289 | 289 | \n? # maybe *one* newline |
290 | 290 | [ ]* |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $link_id = strtolower($matches[1]); |
321 | 321 | $url = $matches[2] == '' ? $matches[3] : $matches[2]; |
322 | 322 | $this->urls[$link_id] = $url; |
323 | - $this->titles[$link_id] =& $matches[4]; |
|
323 | + $this->titles[$link_id] = & $matches[4]; |
|
324 | 324 | return ''; // String that will replace the block |
325 | 325 | } |
326 | 326 | |
@@ -352,9 +352,9 @@ discard block |
||
352 | 352 | * * List "b" is made of tags which are always block-level; |
353 | 353 | */ |
354 | 354 | $block_tags_a_re = 'ins|del'; |
355 | - $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. |
|
356 | - 'script|noscript|style|form|fieldset|iframe|math|svg|'. |
|
357 | - 'article|section|nav|aside|hgroup|header|footer|'. |
|
355 | + $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|' . |
|
356 | + 'script|noscript|style|form|fieldset|iframe|math|svg|' . |
|
357 | + 'article|section|nav|aside|hgroup|header|footer|' . |
|
358 | 358 | 'figure'; |
359 | 359 | |
360 | 360 | // Regular expression for the content of a block tag. |
@@ -379,12 +379,12 @@ discard block |
||
379 | 379 | [^<]+ # content without tag |
380 | 380 | | |
381 | 381 | <\2 # nested opening tag |
382 | - '.$attr.' # attributes |
|
382 | + '.$attr . ' # attributes |
|
383 | 383 | (?> |
384 | 384 | /> |
385 | 385 | | |
386 | - >', $nested_tags_level). // end of opening tag |
|
387 | - '.*?'. // last level nested tag content |
|
386 | + >', $nested_tags_level) . // end of opening tag |
|
387 | + '.*?' . // last level nested tag content |
|
388 | 388 | str_repeat(' |
389 | 389 | </\2\s*> # closing nested tag |
390 | 390 | ) |
@@ -420,20 +420,20 @@ discard block |
||
420 | 420 | # Match from `\n<tag>` to `</tag>\n`, handling nested tags |
421 | 421 | # in between. |
422 | 422 | |
423 | - [ ]{0,'.$less_than_tab.'} |
|
424 | - <('.$block_tags_b_re.')# start tag = $2 |
|
425 | - '.$attr.'> # attributes followed by > and \n |
|
426 | - '.$content.' # content, support nesting |
|
423 | + [ ]{0,'.$less_than_tab . '} |
|
424 | + <('.$block_tags_b_re . ')# start tag = $2 |
|
425 | + '.$attr . '> # attributes followed by > and \n |
|
426 | + '.$content . ' # content, support nesting |
|
427 | 427 | </\2> # the matching end tag |
428 | 428 | [ ]* # trailing spaces/tabs |
429 | 429 | (?=\n+|\Z) # followed by a newline or end of document |
430 | 430 | |
431 | 431 | | # Special version for tags of group a. |
432 | 432 | |
433 | - [ ]{0,'.$less_than_tab.'} |
|
434 | - <('.$block_tags_a_re.')# start tag = $3 |
|
435 | - '.$attr.'>[ ]*\n # attributes followed by > |
|
436 | - '.$content2.' # content, support nesting |
|
433 | + [ ]{0,'.$less_than_tab . '} |
|
434 | + <('.$block_tags_a_re . ')# start tag = $3 |
|
435 | + '.$attr . '>[ ]*\n # attributes followed by > |
|
436 | + '.$content2 . ' # content, support nesting |
|
437 | 437 | </\3> # the matching end tag |
438 | 438 | [ ]* # trailing spaces/tabs |
439 | 439 | (?=\n+|\Z) # followed by a newline or end of document |
@@ -441,16 +441,16 @@ discard block |
||
441 | 441 | | # Special case just for <hr />. It was easier to make a special |
442 | 442 | # case than to make the other regex more complicated. |
443 | 443 | |
444 | - [ ]{0,'.$less_than_tab.'} |
|
444 | + [ ]{0,'.$less_than_tab . '} |
|
445 | 445 | <(hr) # start tag = $2 |
446 | - '.$attr.' # attributes |
|
446 | + '.$attr . ' # attributes |
|
447 | 447 | /?> # the matching end tag |
448 | 448 | [ ]* |
449 | 449 | (?=\n{2,}|\Z) # followed by a blank line or end of document |
450 | 450 | |
451 | 451 | | # Special case for standalone HTML comments: |
452 | 452 | |
453 | - [ ]{0,'.$less_than_tab.'} |
|
453 | + [ ]{0,'.$less_than_tab . '} |
|
454 | 454 | (?s: |
455 | 455 | <!-- .*? --> |
456 | 456 | ) |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | | # PHP and ASP-style processor instructions (<? and <%) |
461 | 461 | |
462 | - [ ]{0,'.$less_than_tab.'} |
|
462 | + [ ]{0,'.$less_than_tab . '} |
|
463 | 463 | (?s: |
464 | 464 | <([?%]) # $2 |
465 | 465 | .*? |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | [ ]* # Tailing spaces |
591 | 591 | $ # End of line. |
592 | 592 | }mx', |
593 | - "\n".$this->hashBlock("<hr$this->empty_element_suffix")."\n", |
|
593 | + "\n" . $this->hashBlock("<hr$this->empty_element_suffix") . "\n", |
|
594 | 594 | $text |
595 | 595 | ); |
596 | 596 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $text = preg_replace_callback('{ |
670 | 670 | ( # wrap whole match in $1 |
671 | 671 | \[ |
672 | - ('.$this->nested_brackets_re.') # link text = $2 |
|
672 | + ('.$this->nested_brackets_re . ') # link text = $2 |
|
673 | 673 | \] |
674 | 674 | |
675 | 675 | [ ]? # one optional space |
@@ -686,14 +686,14 @@ discard block |
||
686 | 686 | $text = preg_replace_callback('{ |
687 | 687 | ( # wrap whole match in $1 |
688 | 688 | \[ |
689 | - ('.$this->nested_brackets_re.') # link text = $2 |
|
689 | + ('.$this->nested_brackets_re . ') # link text = $2 |
|
690 | 690 | \] |
691 | 691 | \( # literal paren |
692 | 692 | [ \n]* |
693 | 693 | (?: |
694 | 694 | <(.+?)> # href = $3 |
695 | 695 | | |
696 | - ('.$this->nested_url_parenthesis_re.') # href = $4 |
|
696 | + ('.$this->nested_url_parenthesis_re . ') # href = $4 |
|
697 | 697 | ) |
698 | 698 | [ \n]* |
699 | 699 | ( # $5 |
@@ -729,9 +729,9 @@ discard block |
||
729 | 729 | * @return string |
730 | 730 | */ |
731 | 731 | protected function _doAnchors_reference_callback($matches) { |
732 | - $whole_match = $matches[1]; |
|
733 | - $link_text = $matches[2]; |
|
734 | - $link_id =& $matches[3]; |
|
732 | + $whole_match = $matches[1]; |
|
733 | + $link_text = $matches[2]; |
|
734 | + $link_id = & $matches[3]; |
|
735 | 735 | |
736 | 736 | if ($link_id == "") { |
737 | 737 | // for shortcut links like [this][] or [this]. |
@@ -747,10 +747,10 @@ discard block |
||
747 | 747 | $url = $this->encodeURLAttribute($url); |
748 | 748 | |
749 | 749 | $result = "<a href=\"$url\""; |
750 | - if ( isset( $this->titles[$link_id] ) ) { |
|
750 | + if (isset($this->titles[$link_id])) { |
|
751 | 751 | $title = $this->titles[$link_id]; |
752 | 752 | $title = $this->encodeAttribute($title); |
753 | - $result .= " title=\"$title\""; |
|
753 | + $result .= " title=\"$title\""; |
|
754 | 754 | } |
755 | 755 | |
756 | 756 | $link_text = $this->runSpanGamut($link_text); |
@@ -768,10 +768,10 @@ discard block |
||
768 | 768 | * @return string |
769 | 769 | */ |
770 | 770 | protected function _doAnchors_inline_callback($matches) { |
771 | - $whole_match = $matches[1]; |
|
772 | - $link_text = $this->runSpanGamut($matches[2]); |
|
773 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
774 | - $title =& $matches[7]; |
|
771 | + $whole_match = $matches[1]; |
|
772 | + $link_text = $this->runSpanGamut($matches[2]); |
|
773 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
774 | + $title = & $matches[7]; |
|
775 | 775 | |
776 | 776 | // If the URL was of the form <s p a c e s> it got caught by the HTML |
777 | 777 | // tag parser and hashed. Need to reverse the process before using |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | $result = "<a href=\"$url\""; |
786 | 786 | if (isset($title)) { |
787 | 787 | $title = $this->encodeAttribute($title); |
788 | - $result .= " title=\"$title\""; |
|
788 | + $result .= " title=\"$title\""; |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | $link_text = $this->runSpanGamut($link_text); |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | $text = preg_replace_callback('{ |
805 | 805 | ( # wrap whole match in $1 |
806 | 806 | !\[ |
807 | - ('.$this->nested_brackets_re.') # alt text = $2 |
|
807 | + ('.$this->nested_brackets_re . ') # alt text = $2 |
|
808 | 808 | \] |
809 | 809 | |
810 | 810 | [ ]? # one optional space |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $text = preg_replace_callback('{ |
824 | 824 | ( # wrap whole match in $1 |
825 | 825 | !\[ |
826 | - ('.$this->nested_brackets_re.') # alt text = $2 |
|
826 | + ('.$this->nested_brackets_re . ') # alt text = $2 |
|
827 | 827 | \] |
828 | 828 | \s? # One optional whitespace character |
829 | 829 | \( # literal paren |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | (?: |
832 | 832 | <(\S*)> # src url = $3 |
833 | 833 | | |
834 | - ('.$this->nested_url_parenthesis_re.') # src url = $4 |
|
834 | + ('.$this->nested_url_parenthesis_re . ') # src url = $4 |
|
835 | 835 | ) |
836 | 836 | [ \n]* |
837 | 837 | ( # $5 |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | if (isset($this->titles[$link_id])) { |
870 | 870 | $title = $this->titles[$link_id]; |
871 | 871 | $title = $this->encodeAttribute($title); |
872 | - $result .= " title=\"$title\""; |
|
872 | + $result .= " title=\"$title\""; |
|
873 | 873 | } |
874 | 874 | $result .= $this->empty_element_suffix; |
875 | 875 | $result = $this->hashPart($result); |
@@ -887,17 +887,17 @@ discard block |
||
887 | 887 | * @return string |
888 | 888 | */ |
889 | 889 | protected function _doImages_inline_callback($matches) { |
890 | - $whole_match = $matches[1]; |
|
891 | - $alt_text = $matches[2]; |
|
892 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
893 | - $title =& $matches[7]; |
|
890 | + $whole_match = $matches[1]; |
|
891 | + $alt_text = $matches[2]; |
|
892 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
893 | + $title = & $matches[7]; |
|
894 | 894 | |
895 | 895 | $alt_text = $this->encodeAttribute($alt_text); |
896 | 896 | $url = $this->encodeURLAttribute($url); |
897 | 897 | $result = "<img src=\"$url\" alt=\"$alt_text\""; |
898 | 898 | if (isset($title)) { |
899 | 899 | $title = $this->encodeAttribute($title); |
900 | - $result .= " title=\"$title\""; // $title already quoted |
|
900 | + $result .= " title=\"$title\""; // $title already quoted |
|
901 | 901 | } |
902 | 902 | $result .= $this->empty_element_suffix; |
903 | 903 | |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | // ID attribute generation |
959 | 959 | $idAtt = $this->_generateIdFromHeaderValue($matches[1]); |
960 | 960 | |
961 | - $block = "<h$level$idAtt>".$this->runSpanGamut($matches[1])."</h$level>"; |
|
961 | + $block = "<h$level$idAtt>" . $this->runSpanGamut($matches[1]) . "</h$level>"; |
|
962 | 962 | return "\n" . $this->hashBlock($block) . "\n\n"; |
963 | 963 | } |
964 | 964 | |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | $idAtt = $this->_generateIdFromHeaderValue($matches[2]); |
973 | 973 | |
974 | 974 | $level = strlen($matches[1]); |
975 | - $block = "<h$level$idAtt>".$this->runSpanGamut($matches[2])."</h$level>"; |
|
975 | + $block = "<h$level$idAtt>" . $this->runSpanGamut($matches[2]) . "</h$level>"; |
|
976 | 976 | return "\n" . $this->hashBlock($block) . "\n\n"; |
977 | 977 | } |
978 | 978 | |
@@ -1020,8 +1020,8 @@ discard block |
||
1020 | 1020 | $whole_list_re = ' |
1021 | 1021 | ( # $1 = whole list |
1022 | 1022 | ( # $2 |
1023 | - ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces |
|
1024 | - ('.$marker_re.') # $4 = first list item marker |
|
1023 | + ([ ]{0,'.$less_than_tab . '}) # $3 = number of spaces |
|
1024 | + ('.$marker_re . ') # $4 = first list item marker |
|
1025 | 1025 | [ ]+ |
1026 | 1026 | ) |
1027 | 1027 | (?s:.+?) |
@@ -1032,13 +1032,13 @@ discard block |
||
1032 | 1032 | (?=\S) |
1033 | 1033 | (?! # Negative lookahead for another list item marker |
1034 | 1034 | [ ]* |
1035 | - '.$marker_re.'[ ]+ |
|
1035 | + '.$marker_re . '[ ]+ |
|
1036 | 1036 | ) |
1037 | 1037 | | |
1038 | 1038 | (?= # Lookahead for another kind of list |
1039 | 1039 | \n |
1040 | 1040 | \3 # Must have the same indentation |
1041 | - '.$other_marker_re.'[ ]+ |
|
1041 | + '.$other_marker_re . '[ ]+ |
|
1042 | 1042 | ) |
1043 | 1043 | ) |
1044 | 1044 | ) |
@@ -1050,13 +1050,13 @@ discard block |
||
1050 | 1050 | if ($this->list_level) { |
1051 | 1051 | $text = preg_replace_callback('{ |
1052 | 1052 | ^ |
1053 | - '.$whole_list_re.' |
|
1053 | + '.$whole_list_re . ' |
|
1054 | 1054 | }mx', |
1055 | 1055 | array($this, '_doLists_callback'), $text); |
1056 | 1056 | } else { |
1057 | 1057 | $text = preg_replace_callback('{ |
1058 | 1058 | (?:(?<=\n)\n|\A\n?) # Must eat the newline |
1059 | - '.$whole_list_re.' |
|
1059 | + '.$whole_list_re . ' |
|
1060 | 1060 | }mx', |
1061 | 1061 | array($this, '_doLists_callback'), $text); |
1062 | 1062 | } |
@@ -1080,7 +1080,7 @@ discard block |
||
1080 | 1080 | $list = $matches[1]; |
1081 | 1081 | $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; |
1082 | 1082 | |
1083 | - $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); |
|
1083 | + $marker_any_re = ($list_type == "ul" ? $marker_ul_re : $marker_ol_re); |
|
1084 | 1084 | |
1085 | 1085 | $list .= "\n"; |
1086 | 1086 | $result = $this->processListItems($list, $marker_any_re); |
@@ -1091,18 +1091,18 @@ discard block |
||
1091 | 1091 | if ($list_type == 'ol') { |
1092 | 1092 | $ol_start_array = array(); |
1093 | 1093 | $ol_start_check = preg_match("/$marker_ol_start_re/", $matches[4], $ol_start_array); |
1094 | - if ($ol_start_check){ |
|
1094 | + if ($ol_start_check) { |
|
1095 | 1095 | $ol_start = $ol_start_array[0]; |
1096 | 1096 | } |
1097 | 1097 | } |
1098 | 1098 | } |
1099 | 1099 | |
1100 | - if ($ol_start > 1 && $list_type == 'ol'){ |
|
1100 | + if ($ol_start > 1 && $list_type == 'ol') { |
|
1101 | 1101 | $result = $this->hashBlock("<$list_type start=\"$ol_start\">\n" . $result . "</$list_type>"); |
1102 | 1102 | } else { |
1103 | 1103 | $result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>"); |
1104 | 1104 | } |
1105 | - return "\n". $result ."\n\n"; |
|
1105 | + return "\n" . $result . "\n\n"; |
|
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | /** |
@@ -1149,12 +1149,12 @@ discard block |
||
1149 | 1149 | $list_str = preg_replace_callback('{ |
1150 | 1150 | (\n)? # leading line = $1 |
1151 | 1151 | (^[ ]*) # leading whitespace = $2 |
1152 | - ('.$marker_any_re.' # list marker and space = $3 |
|
1152 | + ('.$marker_any_re . ' # list marker and space = $3 |
|
1153 | 1153 | (?:[ ]+|(?=\n)) # space only required if item is not empty |
1154 | 1154 | ) |
1155 | 1155 | ((?s:.*?)) # list item text = $4 |
1156 | 1156 | (?:(\n+(?=\n))|\n) # tailing blank line = $5 |
1157 | - (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) |
|
1157 | + (?= \n* (\z | \2 ('.$marker_any_re . ') (?:[ ]+|(?=\n)))) |
|
1158 | 1158 | }xm', |
1159 | 1159 | array($this, '_processListItems_callback'), $list_str); |
1160 | 1160 | |
@@ -1169,17 +1169,17 @@ discard block |
||
1169 | 1169 | */ |
1170 | 1170 | protected function _processListItems_callback($matches) { |
1171 | 1171 | $item = $matches[4]; |
1172 | - $leading_line =& $matches[1]; |
|
1173 | - $leading_space =& $matches[2]; |
|
1172 | + $leading_line = & $matches[1]; |
|
1173 | + $leading_space = & $matches[2]; |
|
1174 | 1174 | $marker_space = $matches[3]; |
1175 | - $tailing_blank_line =& $matches[5]; |
|
1175 | + $tailing_blank_line = & $matches[5]; |
|
1176 | 1176 | |
1177 | 1177 | if ($leading_line || $tailing_blank_line || |
1178 | 1178 | preg_match('/\n{2,}/', $item)) |
1179 | 1179 | { |
1180 | 1180 | // Replace marker with the appropriate whitespace indentation |
1181 | 1181 | $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; |
1182 | - $item = $this->runBlockGamut($this->outdent($item)."\n"); |
|
1182 | + $item = $this->runBlockGamut($this->outdent($item) . "\n"); |
|
1183 | 1183 | } else { |
1184 | 1184 | // Recursion for sub-lists: |
1185 | 1185 | $item = $this->doLists($this->outdent($item)); |
@@ -1199,11 +1199,11 @@ discard block |
||
1199 | 1199 | (?:\n\n|\A\n?) |
1200 | 1200 | ( # $1 = the code block -- one or more lines, starting with a space/tab |
1201 | 1201 | (?> |
1202 | - [ ]{'.$this->tab_width.'} # Lines must start with a tab or a tab-width of spaces |
|
1202 | + [ ]{'.$this->tab_width . '} # Lines must start with a tab or a tab-width of spaces |
|
1203 | 1203 | .*\n+ |
1204 | 1204 | )+ |
1205 | 1205 | ) |
1206 | - ((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc |
|
1206 | + ((?=^[ ]{0,'.$this->tab_width . '}\S)|\Z) # Lookahead for non-space at line-start, or end of doc |
|
1207 | 1207 | }xm', |
1208 | 1208 | array($this, '_doCodeBlocks_callback'), $text); |
1209 | 1209 | |
@@ -1331,8 +1331,8 @@ discard block |
||
1331 | 1331 | // Each token is then passed to handleSpanToken. |
1332 | 1332 | $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); |
1333 | 1333 | $text_stack[0] .= $parts[0]; |
1334 | - $token =& $parts[1]; |
|
1335 | - $text =& $parts[2]; |
|
1334 | + $token = & $parts[1]; |
|
1335 | + $text = & $parts[2]; |
|
1336 | 1336 | |
1337 | 1337 | if (empty($token)) { |
1338 | 1338 | // Reached end of text span: empty stack without emitting. |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | } else { |
1360 | 1360 | // Other closing marker: close one em or strong and |
1361 | 1361 | // change current token state to match the other |
1362 | - $token_stack[0] = str_repeat($token{0}, 3-$token_len); |
|
1362 | + $token_stack[0] = str_repeat($token{0}, 3 - $token_len); |
|
1363 | 1363 | $tag = $token_len == 2 ? "strong" : "em"; |
1364 | 1364 | $span = $text_stack[0]; |
1365 | 1365 | $span = $this->runSpanGamut($span); |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | } |
1706 | 1706 | |
1707 | 1707 | $chars = preg_split('/(?<!^)(?!$)/', $text); |
1708 | - $seed = (int)abs(crc32($text) / strlen($text)); // Deterministic seed. |
|
1708 | + $seed = (int) abs(crc32($text) / strlen($text)); // Deterministic seed. |
|
1709 | 1709 | |
1710 | 1710 | foreach ($chars as $key => $char) { |
1711 | 1711 | $ord = ord($char); |
@@ -1718,9 +1718,9 @@ discard block |
||
1718 | 1718 | if ($r > 90 && strpos('@"&>', $char) === false) { |
1719 | 1719 | /* do nothing */ |
1720 | 1720 | } else if ($r < 45) { |
1721 | - $chars[$key] = '&#x'.dechex($ord).';'; |
|
1721 | + $chars[$key] = '&#x' . dechex($ord) . ';'; |
|
1722 | 1722 | } else { |
1723 | - $chars[$key] = '&#'.$ord.';'; |
|
1723 | + $chars[$key] = '&#' . $ord . ';'; |
|
1724 | 1724 | } |
1725 | 1725 | } |
1726 | 1726 | } |
@@ -1742,11 +1742,11 @@ discard block |
||
1742 | 1742 | |
1743 | 1743 | $span_re = '{ |
1744 | 1744 | ( |
1745 | - \\\\'.$this->escape_chars_re.' |
|
1745 | + \\\\'.$this->escape_chars_re . ' |
|
1746 | 1746 | | |
1747 | 1747 | (?<![`\\\\]) |
1748 | 1748 | `+ # code span marker |
1749 | - '.( $this->no_markup ? '' : ' |
|
1749 | + '.($this->no_markup ? '' : ' |
|
1750 | 1750 | | |
1751 | 1751 | <!-- .*? --> # comment |
1752 | 1752 | | |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag |
1763 | 1763 | | |
1764 | 1764 | </[-a-zA-Z0-9:_]+\s*> # closing tag |
1765 | - ').' |
|
1765 | + ') . ' |
|
1766 | 1766 | ) |
1767 | 1767 | }xs'; |
1768 | 1768 | |
@@ -1799,10 +1799,10 @@ discard block |
||
1799 | 1799 | protected function handleSpanToken($token, &$str) { |
1800 | 1800 | switch ($token{0}) { |
1801 | 1801 | case "\\": |
1802 | - return $this->hashPart("&#". ord($token{1}). ";"); |
|
1802 | + return $this->hashPart("&#" . ord($token{1}) . ";"); |
|
1803 | 1803 | case "`": |
1804 | 1804 | // Search for end marker in remaining text. |
1805 | - if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', |
|
1805 | + if (preg_match('/^(.*?[^`])' . preg_quote($token) . '(?!`)(.*)$/sm', |
|
1806 | 1806 | $str, $matches)) |
1807 | 1807 | { |
1808 | 1808 | $str = $matches[2]; |