From 033e93729d6fd503e215ea7771618d655ad4967c Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 5 Apr 2021 00:04:58 +0200 Subject: MarkdownRenderer: use unordered list style from config --- src/renderers/markdownrenderer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/renderers/markdownrenderer.cpp') 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); -- cgit v1.2.3