A bit more advanced

master
Melroy van den Berg 2020-11-13 05:36:21 +01:00
parent 34e034c887
commit ec4ef4ad02
3 changed files with 16 additions and 7 deletions

View File

@ -17,15 +17,18 @@
<widget class="QLabel" name="output">
<property name="geometry">
<rect>
<x>190</x>
<y>80</y>
<width>131</width>
<height>61</height>
<x>30</x>
<y>0</y>
<width>771</width>
<height>291</height>
</rect>
</property>
<property name="text">
<string>Empty</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">

View File

@ -37,11 +37,12 @@ QString const MarkdownRender::render()
}
QTextStream instream(&file);
QString line = instream.readLine();
const char *LineCStr = line.toStdString().c_str();
QString line = instream.readAll();
file.close();
const char *LineCStr = line.toLocal8Bit().data();
char *message = toLayout(LineCStr);
QString output = QString::fromUtf8(message);
free(message);
return output;
@ -154,6 +155,11 @@ int MarkdownRender::S_render_node(cmark_renderer *renderer, cmark_node *node,
case CMARK_NODE_STRONG:
qDebug() << "Bold" << endl;
if (entering) {
LIT("[b]");
} else {
LIT("[/b]");
}
break;
case CMARK_NODE_EMPH:

View File

@ -1 +1 @@
Hello *World*
Hello *World*, What a **happy** day!