mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 23:11:19 +01:00
Relax markdown parser
This commit is contained in:
parent
1726441d54
commit
ee226b54fa
@ -9,8 +9,9 @@ Features:
|
|||||||
Fixes:
|
Fixes:
|
||||||
- Improved the `markdownEscape` function!
|
- Improved the `markdownEscape` function!
|
||||||
- Translated even more MadelineProto UI elements!
|
- Translated even more MadelineProto UI elements!
|
||||||
- Now the same static analysis rules are applied for both plugins and simple event handlers.
|
- Improve the static analyzer.
|
||||||
- Made some fixes to simple filters.
|
- Made some fixes to simple filters.
|
||||||
|
- Relax markdown parser.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -79,7 +79,10 @@ final class MarkdownEntities extends Entities
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($next !== '(') {
|
if ($next !== '(') {
|
||||||
throw new AssertionError("( expected @ pos $offset!");
|
[, $start] = \array_pop($stack);
|
||||||
|
$message .= '['.$piece.$char;
|
||||||
|
$messageLen += StrTools::mbStrlen($piece)+2;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
$offset++;
|
$offset++;
|
||||||
$char = "](";
|
$char = "](";
|
||||||
|
@ -349,6 +349,12 @@ class EntitiesTest extends MadelineTestCase
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'markdown',
|
||||||
|
'[not a link]',
|
||||||
|
'[not a link]',
|
||||||
|
[],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'html',
|
'html',
|
||||||
'<a href="https://google.com/">link </a>test',
|
'<a href="https://google.com/">link </a>test',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user