summaryrefslogtreecommitdiffstats
path: root/application/dialogs
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-16 19:33:53 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-16 19:33:53 +0200
commit43c777f3869922d4f74d406d75f3ca3d05cb9617 (patch)
tree2ff4efac16bd77a84cd16acd9c10360f5edf820d /application/dialogs
parenta39fb1ef173ee38acb96a64e58b4fd347713c333 (diff)
downloadMultiMC-43c777f3869922d4f74d406d75f3ca3d05cb9617.tar
MultiMC-43c777f3869922d4f74d406d75f3ca3d05cb9617.tar.gz
MultiMC-43c777f3869922d4f74d406d75f3ca3d05cb9617.tar.lz
MultiMC-43c777f3869922d4f74d406d75f3ca3d05cb9617.tar.xz
MultiMC-43c777f3869922d4f74d406d75f3ca3d05cb9617.zip
NOISSUE add some functionality to the derpy markdown changelog thing
Diffstat (limited to 'application/dialogs')
-rw-r--r--application/dialogs/UpdateDialog.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/application/dialogs/UpdateDialog.cpp b/application/dialogs/UpdateDialog.cpp
index 31f2de29..37e44b1e 100644
--- a/application/dialogs/UpdateDialog.cpp
+++ b/application/dialogs/UpdateDialog.cpp
@@ -57,6 +57,9 @@ QString reprocessMarkdown(QString markdown)
{
// [GitHub issues](https://github.com/MultiMC/MultiMC5/issues)
line.replace(QRegExp("\\[([^\\]]+)\\]\\(([^\\)]+)\\)"), "<a href=\"\\2\">\\1</a>");
+ line.replace(QRegExp("GH-([0-9]+)"), "<a href=\"https://github.com/MultiMC/MultiMC5/issues/\\1\">GH-\\1</a>");
+ line.replace(QRegExp("\\*\\*([^*]+)\\*\\*"), "<b>\\1</b>");
+ line.replace(QRegExp("\\*([^*]+)\\*"), "<i>\\1</i>");
return line;
};
for(auto line: lines)
@@ -68,6 +71,14 @@ QString reprocessMarkdown(QString markdown)
else switch (state)
{
case BASE:
+ if(line.startsWith("####"))
+ {
+ html << "<h4>" << procLine(line.mid(4)) << "</h4>\n";
+ }
+ if(line.startsWith("###"))
+ {
+ html << "<h3>" << procLine(line.mid(3)) << "</h3>\n";
+ }
if(line.startsWith("##"))
{
html << "<h2>" << procLine(line.mid(2)) << "</h2>\n";
@@ -85,6 +96,18 @@ QString reprocessMarkdown(QString markdown)
else qCritical() << "Invalid input on line " << i << ": " << line;
break;
case LIST1:
+ if(line.startsWith("####"))
+ {
+ state = BASE;
+ html << "</ul>\n";
+ html << "<h4>" << procLine(line.mid(4)) << "</h4>\n";
+ }
+ else if(line.startsWith("###"))
+ {
+ state = BASE;
+ html << "</ul>\n";
+ html << "<h3>" << procLine(line.mid(3)) << "</h3>\n";
+ }
if(line.startsWith("##"))
{
state = BASE;
@@ -110,6 +133,20 @@ QString reprocessMarkdown(QString markdown)
else qCritical() << "Invalid input on line " << i << ": " << line;
break;
case LIST2:
+ if(line.startsWith("####"))
+ {
+ state = BASE;
+ html << "</ul>\n";
+ html << "</ul>\n";
+ html << "<h4>" << procLine(line.mid(4)) << "</h4>\n";
+ }
+ else if(line.startsWith("###"))
+ {
+ state = BASE;
+ html << "</ul>\n";
+ html << "</ul>\n";
+ html << "<h3>" << procLine(line.mid(3)) << "</h3>\n";
+ }
if(line.startsWith("##"))
{
state = BASE;