mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
98aa922c31
commit
998f0915db
|
@ -201,11 +201,11 @@ QString ChatMessage::detectMarkdown(const QString &str)
|
||||||
{
|
{
|
||||||
QString snipCheck = out.mid(offset-1,exp.cap(0).length()+2);
|
QString snipCheck = out.mid(offset-1,exp.cap(0).length()+2);
|
||||||
QString snippet = exp.cap(0).trimmed();
|
QString snippet = exp.cap(0).trimmed();
|
||||||
|
|
||||||
QString htmledSnippet;
|
QString htmledSnippet;
|
||||||
|
|
||||||
// Only parse if surrounded by spaces, newline(s) and/or beginning/end of line
|
// Only parse if surrounded by spaces, newline(s) and/or beginning/end of line
|
||||||
if ((snipCheck.startsWith(' ') || snipCheck.startsWith('>') || offset == 0) && ((snipCheck.endsWith(' ') || snipCheck.endsWith('<')) || offset + snippet.toHtmlEscaped().length() == out.toHtmlEscaped().length()))
|
if ((snipCheck.startsWith(' ') || snipCheck.startsWith('>') || offset == 0)
|
||||||
|
&& ((snipCheck.endsWith(' ') || snipCheck.endsWith('<')) || offset + snippet.length() == out.length()))
|
||||||
{
|
{
|
||||||
int mul = 0; // Determines how many characters to strip from markdown text
|
int mul = 0; // Determines how many characters to strip from markdown text
|
||||||
// Set mul depending on markdownPreference
|
// Set mul depending on markdownPreference
|
||||||
|
|
Loading…
Reference in New Issue
Block a user