azu / azu/gitbook-plugin-include-codeblock

Only match includes at the beginning of the line

未关闭
#67 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
40
派生
25
PR 合并指标
30 天内没有已合并 PR

描述

It seems that this is matching all links whether they start at the beginning of the line or not. Here's the regex in use:

```regexp
/\[(?=((?:[^\]]|\\.)*))\1\]\((?=((?:[^\)]|\\.)*))\2\)/gm
```

Seems like a simple fix would be:

```regexp
/^\[(?=((?:[^\]]|\\.)*))\1\]\((?=((?:[^\)]|\\.)*))\2\)/gm
```

This is related to #65. Another fix that would resolve both issues, and increase the performance of the plugin:

```regexp
/^\[(?=(import|include(?:[^\]]|\\.)*))\1\]\((?=((?:[^\)]|\\.)*))\2\)/gm
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

Locate the regular expression used by the plugin to match include links, then reproduce the issue with links at the start and middle of lines. Compare the current behavior with the proposed expressions and verify that matching is limited to line beginnings, including the related behavior described in #65.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
tooling
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。