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
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

找出外掛程式用來比對 include 連結的正規表示式,然後使用位於行首和行中間的連結重現此問題。比較目前的行為與提議的表示式,並驗證比對僅限於行首,包括 #65 中描述的相關行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
tooling
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。