azu / azu/gitbook-plugin-include-codeblock

Only match includes at the beginning of the line

Offen
#67 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
40
Forks
25
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.