1 | <?php |
||
12 | class Parser extends ParserBase |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritdoc} |
||
16 | */ |
||
17 | public function parse($text, array $matches) |
||
25 | |||
26 | /** |
||
27 | * Linkify given URL at given position |
||
28 | * |
||
29 | * @param integer $tagPos URL's position in the text |
||
30 | * @param string $url URL |
||
31 | * @return void |
||
32 | */ |
||
33 | protected function linkifyUrl($tagPos, $url) |
||
58 | |||
59 | /** |
||
60 | * Remove trailing punctuation from given URL |
||
61 | * |
||
62 | * We remove most ASCII non-letters and Unicode punctuation from the end of the string. |
||
63 | * Exceptions: |
||
64 | * - dashes (some YouTube URLs end with a dash due to the video ID) |
||
65 | * - equal signs (because of "foo?bar="), |
||
66 | * - trailing slashes, |
||
67 | * - closing parentheses are balanced separately. |
||
68 | * |
||
69 | * @param string $url Original URL |
||
70 | * @return string Trimmed URL |
||
71 | */ |
||
72 | protected function trimUrl($url) |
||
76 | } |