Skip to content

Commit fa9d0bc

Browse files
committed
Merge branch 'useless_ref_this' of git://github.com/olvlvl/php-markdown into lib
Conflicts: Michelf/Markdown.php
2 parents 7b58700 + 27387d3 commit fa9d0bc

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

Michelf/Markdown.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected function stripLinkDefinitions($text) {
209209
)? # title is optional
210210
(?:\n+|\Z)
211211
}xm',
212-
array(&$this, '_stripLinkDefinitions_callback'),
212+
array($this, '_stripLinkDefinitions_callback'),
213213
$text);
214214
return $text;
215215
}
@@ -356,7 +356,7 @@ protected function hashHTMLBlocks($text) {
356356
357357
)
358358
)}Sxmi',
359-
array(&$this, '_hashHTMLBlocks_callback'),
359+
array($this, '_hashHTMLBlocks_callback'),
360360
$text);
361361

362362
return $text;
@@ -500,7 +500,7 @@ protected function runSpanGamut($text) {
500500
protected function doHardBreaks($text) {
501501
# Do hard breaks:
502502
return preg_replace_callback('/ {2,}\n/',
503-
array(&$this, '_doHardBreaks_callback'), $text);
503+
array($this, '_doHardBreaks_callback'), $text);
504504
}
505505
protected function _doHardBreaks_callback($matches) {
506506
return $this->hashPart("<br$this->empty_element_suffix\n");
@@ -531,7 +531,7 @@ protected function doAnchors($text) {
531531
\]
532532
)
533533
}xs',
534-
array(&$this, '_doAnchors_reference_callback'), $text);
534+
array($this, '_doAnchors_reference_callback'), $text);
535535

536536
#
537537
# Next, inline-style links: [link text](url "optional title")
@@ -558,7 +558,7 @@ protected function doAnchors($text) {
558558
\)
559559
)
560560
}xs',
561-
array(&$this, '_doAnchors_inline_callback'), $text);
561+
array($this, '_doAnchors_inline_callback'), $text);
562562

563563
#
564564
# Last, handle reference-style shortcuts: [link text]
@@ -572,7 +572,7 @@ protected function doAnchors($text) {
572572
\]
573573
)
574574
}xs',
575-
array(&$this, '_doAnchors_reference_callback'), $text);
575+
array($this, '_doAnchors_reference_callback'), $text);
576576

577577
$this->in_anchor = false;
578578
return $text;
@@ -654,7 +654,7 @@ protected function doImages($text) {
654654
655655
)
656656
}xs',
657-
array(&$this, '_doImages_reference_callback'), $text);
657+
array($this, '_doImages_reference_callback'), $text);
658658

659659
#
660660
# Next, handle inline images: ![alt text](url "optional title")
@@ -683,7 +683,7 @@ protected function doImages($text) {
683683
\)
684684
)
685685
}xs',
686-
array(&$this, '_doImages_inline_callback'), $text);
686+
array($this, '_doImages_inline_callback'), $text);
687687

688688
return $text;
689689
}
@@ -743,7 +743,7 @@ protected function doHeaders($text) {
743743
# --------
744744
#
745745
$text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx',
746-
array(&$this, '_doHeaders_callback_setext'), $text);
746+
array($this, '_doHeaders_callback_setext'), $text);
747747

748748
# atx-style headers:
749749
# # Header 1
@@ -760,7 +760,7 @@ protected function doHeaders($text) {
760760
\#* # optional closing #\'s (not counted)
761761
\n+
762762
}xm',
763-
array(&$this, '_doHeaders_callback_atx'), $text);
763+
array($this, '_doHeaders_callback_atx'), $text);
764764

765765
return $text;
766766
}
@@ -833,14 +833,14 @@ protected function doLists($text) {
833833
^
834834
'.$whole_list_re.'
835835
}mx',
836-
array(&$this, '_doLists_callback'), $text);
836+
array($this, '_doLists_callback'), $text);
837837
}
838838
else {
839839
$text = preg_replace_callback('{
840840
(?:(?<=\n)\n|\A\n?) # Must eat the newline
841841
'.$whole_list_re.'
842842
}mx',
843-
array(&$this, '_doLists_callback'), $text);
843+
array($this, '_doLists_callback'), $text);
844844
}
845845
}
846846

@@ -907,7 +907,7 @@ protected function processListItems($list_str, $marker_any_re) {
907907
(?:(\n+(?=\n))|\n) # tailing blank line = $5
908908
(?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n))))
909909
}xm',
910-
array(&$this, '_processListItems_callback'), $list_str);
910+
array($this, '_processListItems_callback'), $list_str);
911911

912912
$this->list_level--;
913913
return $list_str;
@@ -951,7 +951,7 @@ protected function doCodeBlocks($text) {
951951
)
952952
((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
953953
}xm',
954-
array(&$this, '_doCodeBlocks_callback'), $text);
954+
array($this, '_doCodeBlocks_callback'), $text);
955955

956956
return $text;
957957
}
@@ -1151,7 +1151,7 @@ protected function doBlockQuotes($text) {
11511151
)+
11521152
)
11531153
/xm',
1154-
array(&$this, '_doBlockQuotes_callback'), $text);
1154+
array($this, '_doBlockQuotes_callback'), $text);
11551155

11561156
return $text;
11571157
}
@@ -1165,7 +1165,7 @@ protected function _doBlockQuotes_callback($matches) {
11651165
# These leading spaces cause problem with <pre> content,
11661166
# so we need to fix that:
11671167
$bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
1168-
array(&$this, '_doBlockQuotes_callback2'), $bq);
1168+
array($this, '_doBlockQuotes_callback2'), $bq);
11691169

11701170
return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n";
11711171
}
@@ -1280,7 +1280,7 @@ protected function encodeAmpsAndAngles($text) {
12801280

12811281
protected function doAutoLinks($text) {
12821282
$text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
1283-
array(&$this, '_doAutoLinks_url_callback'), $text);
1283+
array($this, '_doAutoLinks_url_callback'), $text);
12841284

12851285
# Email addresses: <address@domain.foo>
12861286
$text = preg_replace_callback('{
@@ -1301,8 +1301,8 @@ protected function doAutoLinks($text) {
13011301
)
13021302
>
13031303
}xi',
1304-
array(&$this, '_doAutoLinks_email_callback'), $text);
1305-
$text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text);
1304+
array($this, '_doAutoLinks_email_callback'), $text);
1305+
$text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array($this, '_doAutoLinks_tel_callback'), $text);
13061306

13071307
return $text;
13081308
}
@@ -1470,7 +1470,7 @@ protected function detab($text) {
14701470
# appropriate number of space between each blocks.
14711471

14721472
$text = preg_replace_callback('/^.*\t.*$/m',
1473-
array(&$this, '_detab_callback'), $text);
1473+
array($this, '_detab_callback'), $text);
14741474

14751475
return $text;
14761476
}
@@ -1510,7 +1510,7 @@ protected function unhash($text) {
15101510
# Swap back in all the tags hashed by _HashHTMLBlocks.
15111511
#
15121512
return preg_replace_callback('/(.)\x1A[0-9]+\1/',
1513-
array(&$this, '_unhash_callback'), $text);
1513+
array($this, '_unhash_callback'), $text);
15141514
}
15151515
protected function _unhash_callback($matches) {
15161516
return $this->html_hashes[$matches[0]];
@@ -1716,7 +1716,7 @@ protected function stripLinkDefinitions($text) {
17161716
(?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr
17171717
(?:\n+|\Z)
17181718
}xm',
1719-
array(&$this, '_stripLinkDefinitions_callback'),
1719+
array($this, '_stripLinkDefinitions_callback'),
17201720
$text);
17211721
return $text;
17221722
}
@@ -2227,7 +2227,7 @@ protected function doAnchors($text) {
22272227
\]
22282228
)
22292229
}xs',
2230-
array(&$this, '_doAnchors_reference_callback'), $text);
2230+
array($this, '_doAnchors_reference_callback'), $text);
22312231

22322232
#
22332233
# Next, inline-style links: [link text](url "optional title")
@@ -2255,7 +2255,7 @@ protected function doAnchors($text) {
22552255
(?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
22562256
)
22572257
}xs',
2258-
array(&$this, '_doAnchors_inline_callback'), $text);
2258+
array($this, '_doAnchors_inline_callback'), $text);
22592259

22602260
#
22612261
# Last, handle reference-style shortcuts: [link text]
@@ -2269,7 +2269,7 @@ protected function doAnchors($text) {
22692269
\]
22702270
)
22712271
}xs',
2272-
array(&$this, '_doAnchors_reference_callback'), $text);
2272+
array($this, '_doAnchors_reference_callback'), $text);
22732273

22742274
$this->in_anchor = false;
22752275
return $text;
@@ -2356,7 +2356,7 @@ protected function doImages($text) {
23562356
23572357
)
23582358
}xs',
2359-
array(&$this, '_doImages_reference_callback'), $text);
2359+
array($this, '_doImages_reference_callback'), $text);
23602360

23612361
#
23622362
# Next, handle inline images: ![alt text](url "optional title")
@@ -2386,7 +2386,7 @@ protected function doImages($text) {
23862386
(?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
23872387
)
23882388
}xs',
2389-
array(&$this, '_doImages_inline_callback'), $text);
2389+
array($this, '_doImages_inline_callback'), $text);
23902390

23912391
return $text;
23922392
}
@@ -2458,7 +2458,7 @@ protected function doHeaders($text) {
24582458
(?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
24592459
[ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer
24602460
}mx',
2461-
array(&$this, '_doHeaders_callback_setext'), $text);
2461+
array($this, '_doHeaders_callback_setext'), $text);
24622462

24632463
# atx-style headers:
24642464
# # Header 1 {#header1}
@@ -2477,7 +2477,7 @@ protected function doHeaders($text) {
24772477
[ ]*
24782478
\n+
24792479
}xm',
2480-
array(&$this, '_doHeaders_callback_atx'), $text);
2480+
array($this, '_doHeaders_callback_atx'), $text);
24812481

24822482
return $text;
24832483
}
@@ -2528,7 +2528,7 @@ protected function doTables($text) {
25282528
)
25292529
(?=\n|\Z) # Stop at final double newline.
25302530
}xm',
2531-
array(&$this, '_doTable_leadingPipe_callback'), $text);
2531+
array($this, '_doTable_leadingPipe_callback'), $text);
25322532

25332533
#
25342534
# Find tables without leading pipe.
@@ -2554,7 +2554,7 @@ protected function doTables($text) {
25542554
)
25552555
(?=\n|\Z) # Stop at final double newline.
25562556
}xm',
2557-
array(&$this, '_DoTable_callback'), $text);
2557+
array($this, '_DoTable_callback'), $text);
25582558

25592559
return $text;
25602560
}
@@ -2678,7 +2678,7 @@ protected function doDefLists($text) {
26782678
(?>\A\n?|(?<=\n\n))
26792679
'.$whole_list_re.'
26802680
}mx',
2681-
array(&$this, '_doDefLists_callback'), $text);
2681+
array($this, '_doDefLists_callback'), $text);
26822682

26832683
return $text;
26842684
}
@@ -2716,7 +2716,7 @@ protected function processDefListItems($list_str) {
27162716
(?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed
27172717
# with a definition mark.
27182718
}xm',
2719-
array(&$this, '_processDefListItems_callback_dt'), $list_str);
2719+
array($this, '_processDefListItems_callback_dt'), $list_str);
27202720

27212721
# Process actual definitions.
27222722
$list_str = preg_replace_callback('{
@@ -2733,7 +2733,7 @@ protected function processDefListItems($list_str) {
27332733
)
27342734
)
27352735
}xm',
2736-
array(&$this, '_processDefListItems_callback_dd'), $list_str);
2736+
array($this, '_processDefListItems_callback_dd'), $list_str);
27372737

27382738
return $list_str;
27392739
}
@@ -2801,7 +2801,7 @@ protected function doFencedCodeBlocks($text) {
28012801
# Closing marker.
28022802
\1 [ ]* (?= \n )
28032803
}xm',
2804-
array(&$this, '_doFencedCodeBlocks_callback'), $text);
2804+
array($this, '_doFencedCodeBlocks_callback'), $text);
28052805

28062806
return $text;
28072807
}
@@ -2811,7 +2811,7 @@ protected function _doFencedCodeBlocks_callback($matches) {
28112811
$codeblock = $matches[4];
28122812
$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
28132813
$codeblock = preg_replace_callback('/^\n+/',
2814-
array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock);
2814+
array($this, '_doFencedCodeBlocks_newlines'), $codeblock);
28152815

28162816
if ($classname != "") {
28172817
if ($classname{0} == '.')
@@ -2914,7 +2914,7 @@ protected function stripFootnotes($text) {
29142914
)*
29152915
)
29162916
}xm',
2917-
array(&$this, '_stripFootnotes_callback'),
2917+
array($this, '_stripFootnotes_callback'),
29182918
$text);
29192919
return $text;
29202920
}
@@ -2942,7 +2942,7 @@ protected function appendFootnotes($text) {
29422942
# Append footnote list to text.
29432943
#
29442944
$text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
2945-
array(&$this, '_appendFootnotes_callback'), $text);
2945+
array($this, '_appendFootnotes_callback'), $text);
29462946

29472947
if (!empty($this->footnotes_ordered)) {
29482948
$text .= "\n\n";
@@ -2974,7 +2974,7 @@ protected function appendFootnotes($text) {
29742974
$footnote .= "\n"; # Need to append newline before parsing.
29752975
$footnote = $this->runBlockGamut("$footnote\n");
29762976
$footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
2977-
array(&$this, '_appendFootnotes_callback'), $footnote);
2977+
array($this, '_appendFootnotes_callback'), $footnote);
29782978

29792979
$attr = str_replace("%%", ++$num, $attr);
29802980
$note_id = $this->encodeAttribute($note_id);
@@ -3057,7 +3057,7 @@ protected function stripAbbreviations($text) {
30573057
^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1
30583058
(.*) # text = $2 (no blank lines allowed)
30593059
}xm',
3060-
array(&$this, '_stripAbbreviations_callback'),
3060+
array($this, '_stripAbbreviations_callback'),
30613061
$text);
30623062
return $text;
30633063
}
@@ -3084,7 +3084,7 @@ protected function doAbbreviations($text) {
30843084
'(?:'.$this->abbr_word_re.')'.
30853085
'(?![\w\x1A])'.
30863086
'}',
3087-
array(&$this, '_doAbbreviations_callback'), $text);
3087+
array($this, '_doAbbreviations_callback'), $text);
30883088
}
30893089
return $text;
30903090
}

0 commit comments

Comments
 (0)