1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fixed HTML chars breaking recognition.

This commit is contained in:
Andrew Morgan 2016-03-21 22:31:23 -04:00
parent 68cad0db38
commit 04ae894fc2

View File

@ -210,8 +210,10 @@ QString ChatMessage::detectMarkdown(const QString &str)
QString htmledSnippet; QString htmledSnippet;
qDebug() << "snipCheck: " << snipCheck << " out: " << out << " snipLength: " << snippet.toHtmlEscaped().length() << " outLength: " << out.toHtmlEscaped().length();
// 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.length())) if ((snipCheck.startsWith(' ') || snipCheck.startsWith('>') || offset == 0) && ((snipCheck.endsWith(' ') || snipCheck.endsWith('<')) || offset + snippet.toHtmlEscaped().length() == out.toHtmlEscaped().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