| @@ 78-87 (lines=10) @@ | ||
| 75 | ], |
|
| 76 | $offset |
|
| 77 | ]; |
|
| 78 | } else { |
|
| 79 | // remove all starting [ markers to avoid next one to be parsed as link |
|
| 80 | $result = '['; |
|
| 81 | $i = 1; |
|
| 82 | while (isset($markdown[$i]) && $markdown[$i] == '[') { |
|
| 83 | $result .= '['; |
|
| 84 | $i++; |
|
| 85 | } |
|
| 86 | return [['text', $result], $i]; |
|
| 87 | } |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| @@ 110-119 (lines=10) @@ | ||
| 107 | ], |
|
| 108 | $offset + 1 |
|
| 109 | ]; |
|
| 110 | } else { |
|
| 111 | // remove all starting [ markers to avoid next one to be parsed as link |
|
| 112 | $result = '!'; |
|
| 113 | $i = 1; |
|
| 114 | while (isset($markdown[$i]) && $markdown[$i] == '[') { |
|
| 115 | $result .= '['; |
|
| 116 | $i++; |
|
| 117 | } |
|
| 118 | return [['text', $result], $i]; |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | protected function parseLinkOrImage($markdown) |
|