Commit f0145e49 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement begin/endheader but it seems not implemented. I need

to fix grantlee too
parent b99f5464
...@@ -421,7 +421,30 @@ void PlainTextMarkupBuilder::beginForeground(const QBrush &brush) ...@@ -421,7 +421,30 @@ void PlainTextMarkupBuilder::beginForeground(const QBrush &brush)
void PlainTextMarkupBuilder::beginHeader(int level) void PlainTextMarkupBuilder::beginHeader(int level)
{ {
Q_UNUSED(level); Q_D(PlainTextMarkupBuilder);
switch (level) {
case 1:
d->m_text.append(QStringLiteral("# "));
break;
case 2:
d->m_text.append(QStringLiteral("## "));
break;
case 3:
d->m_text.append(QStringLiteral("### "));
break;
case 4:
d->m_text.append(QStringLiteral("#### "));
break;
case 5:
d->m_text.append(QStringLiteral("##### "));
break;
case 6:
d->m_text.append(QStringLiteral("###### "));
break;
default:
break;
}
} }
void PlainTextMarkupBuilder::beginTable(qreal cellpadding, qreal cellspacing, void PlainTextMarkupBuilder::beginTable(qreal cellpadding, qreal cellspacing,
...@@ -470,7 +493,30 @@ void PlainTextMarkupBuilder::endForeground() ...@@ -470,7 +493,30 @@ void PlainTextMarkupBuilder::endForeground()
void PlainTextMarkupBuilder::endHeader(int level) void PlainTextMarkupBuilder::endHeader(int level)
{ {
Q_UNUSED(level) Q_D(PlainTextMarkupBuilder);
qDebug() << " void PlainTextMarkupBuilder::endHeader(int level)"<< level;
switch (level) {
case 1:
d->m_text.append(QStringLiteral(" #\n"));
break;
case 2:
d->m_text.append(QStringLiteral(" ##\n"));
break;
case 3:
d->m_text.append(QStringLiteral(" ###\n"));
break;
case 4:
d->m_text.append(QStringLiteral(" ####\n"));
break;
case 5:
d->m_text.append(QStringLiteral(" #####\n"));
break;
case 6:
d->m_text.append(QStringLiteral(" ######\n"));
break;
default:
break;
}
} }
void PlainTextMarkupBuilder::endTable() void PlainTextMarkupBuilder::endTable()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment