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

Changed asterisk rule to bold instead of italics. Fixed extraneous container in settings.

This commit is contained in:
Andrew Morgan 2016-01-28 14:08:12 -08:00
parent aa5d0f660c
commit a5f9e77a6b
2 changed files with 5 additions and 12 deletions

View File

@ -187,7 +187,7 @@ QString ChatMessage::detectMarkdown(const QString &str)
// Create regex for certain markdown syntax // Create regex for certain markdown syntax
QRegExp exp("(\\*\\*)([^\\*\\*]{2,})(\\*\\*)" // Bold **text** QRegExp exp("(\\*\\*)([^\\*\\*]{2,})(\\*\\*)" // Bold **text**
"|(\\*)([^\\*]{2,})(\\*)" // Italics *text* "|(\\*)([^\\*]{2,})(\\*)" // Bold *text*
"|(\\_)([^\\_]{2,})(\\_)" // Italics _text_ "|(\\_)([^\\_]{2,})(\\_)" // Italics _text_
"|(\\_\\_)([^\\_\\_]{2,})(\\_\\_)" // Italics __text__ "|(\\_\\_)([^\\_\\_]{2,})(\\_\\_)" // Italics __text__
"|(\\-)([^\\-]{2,})(\\-)" // Underline -text- "|(\\-)([^\\-]{2,})(\\-)" // Underline -text-
@ -230,8 +230,8 @@ QString ChatMessage::detectMarkdown(const QString &str)
// Match captured string to corresponding md format // Match captured string to corresponding md format
if (exp.cap(1) == "**") // Bold **text** if (exp.cap(1) == "**") // Bold **text**
htmledSnippet = QString(" <b>%1</b> ").arg(snippet.mid(mul,snippet.length()-2*mul)); htmledSnippet = QString(" <b>%1</b> ").arg(snippet.mid(mul,snippet.length()-2*mul));
else if (exp.cap(4) == "*" && snippet.length() > 2) // Italics *text* else if (exp.cap(4) == "*" && snippet.length() > 2) // Bold *text*
htmledSnippet = QString(" <i>%1</i> ").arg(snippet.mid(mul/2,snippet.length()-mul)); htmledSnippet = QString(" <b>%1</b> ").arg(snippet.mid(mul/2,snippet.length()-mul));
else if (exp.cap(7) == "_" && snippet.length() > 2) // Italics _text_ else if (exp.cap(7) == "_" && snippet.length() > 2) // Italics _text_
htmledSnippet = QString(" <i>%1</i> ").arg(snippet.mid(mul/2,snippet.length()-mul)); htmledSnippet = QString(" <i>%1</i> ").arg(snippet.mid(mul/2,snippet.length()-mul));
else if (exp.cap(10) == "__"&& snippet.length() > 4) // Italics __text__ else if (exp.cap(10) == "__"&& snippet.length() > 4) // Italics __text__

View File

@ -39,8 +39,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1280</width> <width>1277</width>
<height>2394</height> <height>1272</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1"> <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1">
@ -481,13 +481,6 @@ will be sent to them when they appear online to you.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>