harttle / md-padding

修复 Markdown 中的混排空格:中英文、数字、链接等。
https://harttle.land/md-padding/
57 stars 5 forks source link

fix: ordered-list prefix, add Math to inline structures, code block parse #25

Closed obgnail closed 10 months ago

obgnail commented 10 months ago

开发者你好。修复三个问题:

fix ordered-list-item isValidPrefix

问题:

有序列表的判断有误。

fix parse: reset blockCodeDelimiter at BlockCode

问题:

parse中的FrontMatter处理逻辑会设置 blockCodeDelimiter,而 BlockCode 没有,导致 blockCodeDelimiter 有误

    else if (c3 === '```' && allow(NodeKind.BlockCode)) {
      push(State.BlockCodeLang)
      i += 3
    }
    else if (c3 === '---' && allowFrontMatter()) {
      push(State.BlockCodeLang)
      blockCodeDelimiter = c3
      i += 3
    }

复现文本:

---
test:1
---

```js
console.log(1)

## fix node-kind: add Math into Inline
问题:

Math 支持 inline 模式,但是没有加入到 inline 变量中

复现文本:
```markdown
- 前$Latex$后
obgnail commented 10 months ago

@harttle 开发者你好,已经加了 testcase。您看一下。

'when there is front matter, the delimiter of the code block should be ``` instead of ---' 这个 testcase 会比较奇怪,因为此时 bug 的情况是 ``` 会被修改成 ---

isBlank 的修改可能需要交还给您处理了,我看了下代码,quote,ordered list,unordered list 使用的都是 " ",需要统一修改。

github-actions[bot] commented 10 months ago

:tada: This PR is included in version 1.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

harttle commented 10 months ago

vscode extension published: https://github.com/harttle/md-padding-vscode/commit/c7fcf6ee4b0ee52d851317edcabdfb040039138b