azu / azu/gitbook-plugin-include-codeblock

Only match includes at the beginning of the line

Đang mở
#67 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
40
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.