diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-04-05 00:04:58 +0200 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-04-05 17:13:58 +0200 |
| commit | 033e93729d6fd503e215ea7771618d655ad4967c (patch) | |
| tree | 7c5f253cbf96edbfc3d700048b71a8d3cdd10eaa /src/renderers/markdownrenderer.cpp | |
| parent | 6dfffb0a2adc1102260cd51e741bcc5f3fdeaf42 (diff) | |
| download | kristall-033e93729d6fd503e215ea7771618d655ad4967c.tar.gz | |
MarkdownRenderer: use unordered list style from config
Diffstat (limited to 'src/renderers/markdownrenderer.cpp')
| -rw-r--r-- | src/renderers/markdownrenderer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/renderers/markdownrenderer.cpp b/src/renderers/markdownrenderer.cpp index b8747f1..c7c3a66 100644 --- a/src/renderers/markdownrenderer.cpp +++ b/src/renderers/markdownrenderer.cpp @@ -80,9 +80,9 @@ struct RenderState } }; -static void renderNode(RenderState &state, cmark_node &node, const QTextCharFormat ¤t_format, int listIndent = 1); +static void renderNode(RenderState &state, cmark_node &node, const QTextCharFormat ¤t_format, int listIndent = 0); -static void renderChildren(RenderState &state, cmark_node & node, const QTextCharFormat ¤t_format, int listIndent = 1) +static void renderChildren(RenderState &state, cmark_node & node, const QTextCharFormat ¤t_format, int listIndent = 0) { for (auto child = cmark_node_first_child(&node); child != nullptr; child = cmark_node_next(child)) { @@ -142,8 +142,9 @@ static void renderNode(RenderState &state, cmark_node & node, const QTextCharFor case CMARK_NODE_LIST: { auto fmt = cursor.blockFormat(); - QTextListFormat listFormat; - listFormat.setIndent(listIndent++); + QTextListFormat listFormat = state.text_style.list_format; + listFormat.setIndent(listFormat.indent() + listIndent); + listIndent++; if(cmark_node_get_list_type(&node) == CMARK_BULLET_LIST) { listFormat.setStyle(QTextListFormat::ListDisc); |
