azu / azu/gitbook-plugin-include-codeblock
Only match includes at the beginning of the line
- Langage dominant
- JavaScript
- Étoiles
- 40
- Forks
- 25
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100