cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

[Bug report]列表和代码块叠加后导致的样式问题

Open wt201501 opened this issue 2 years ago • 2 comments

例如:

1. xxxxxxxx
    - yyyyyyyyyyyy
        ```cmake
        add_executable(testexe)
        target_sources(testexe PRIVATE main.cpp)
        target_link_libraries(testexe PRIVATE testlib)
        ```
    - zzzzzzzzzzzzzz
        ```cpp
        #include <iostream>
        #include "testlib.hpp"
        #include "testlib2.hpp"

        int main() {
            int a = 10, b = 8, c = 2;
            std::cout << add(a, b) << std::endl;
            std::cout << foo(a, b, c) << std::endl;
        }
        ```

会渲染成下面这个样子: 企业微信截图_16617586843146

wt201501 avatar Aug 29 '22 07:08 wt201501

收到,似乎是缩进代码块和普通代码块语法冲突导致的。

临时修复方案: 在初始化时传入参数 engine.syntax.indentedCodeBlock = false关闭缩进代码块语法 见 https://github.com/Tencent/cherry-markdown/blob/main/src/Cherry.config.js

sunsonliu avatar Aug 30 '22 04:08 sunsonliu

收到,似乎是缩进代码块和普通代码块语法冲突导致的。

临时修复方案: 在初始化时传入参数 engine.syntax.indentedCodeBlock = false关闭缩进代码块语法 见 https://github.com/Tencent/cherry-markdown/blob/main/src/Cherry.config.js

但我删除代码块之间的空行就解决了 image

ufec avatar Sep 17 '22 00:09 ufec

收到,似乎是缩进代码块和普通代码块语法冲突导致的。 临时修复方案: 在初始化时传入参数 engine.syntax.indentedCodeBlock = false关闭缩进代码块语法 见 https://github.com/Tencent/cherry-markdown/blob/main/src/Cherry.config.js

但我删除代码块之间的空行就解决了 image

是的,有空行+缩进的时候就会命中缩进代码快的语法规则。。。

sunsonliu avatar Sep 18 '22 03:09 sunsonliu