mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve markdown parsing.
This commit is contained in:
parent
921c27c9b1
commit
8550099110
1 changed files with 6 additions and 0 deletions
|
@ -1565,6 +1565,12 @@ MarkdownPart GetMarkdownPart(EntityInTextType type, const QString &text, int mat
|
||||||
Unexpected("Type in GetMardownPart()");
|
Unexpected("Type in GetMardownPart()");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (matchFromOffset > 1) {
|
||||||
|
// If matchFromOffset is after some separator that is allowed to
|
||||||
|
// start our markdown tag the tag itself will start where we want it.
|
||||||
|
// So we allow to see this separator and make a match.
|
||||||
|
--matchFromOffset;
|
||||||
|
}
|
||||||
auto match = regexp().match(text, matchFromOffset);
|
auto match = regexp().match(text, matchFromOffset);
|
||||||
if (!match.hasMatch()) {
|
if (!match.hasMatch()) {
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue