Skip to content

fix: exclude URL(http/https/ftp) patterns from markdown-it-include target#351

Open
fukusuket wants to merge 1 commit intoyzane:masterfrom
fukusuket:fix-ENOENT-error
Open

fix: exclude URL(http/https/ftp) patterns from markdown-it-include target#351
fukusuket wants to merge 1 commit intoyzane:masterfrom
fukusuket:fix-ENOENT-error

Conversation

@fukusuket
Copy link

@fukusuket fukusuket commented Jan 14, 2024

Hello, Thank you so much for great tool :)
The issue #181 also occurred in my environment(win10/macOS/vscode-markdown-pdf 1.5.0), so I fixed it.

What Changed

Changed the regular expression targeted by markdown-it-include

About the changed regular expression in this PR

before fix

All cases containing URL link patterns are targets of markdown-it-include as follows:
スクリーンショット 2024-01-14 20 05 32

after fix

URL link patterns are not targets of markdown-it-include as follows: (By using a negative lookahead regular expression)
スクリーンショット 2024-01-14 20 05 39

I would appreciate it if you could review.
Thanks again maintaining great tool !

@fukusuket fukusuket marked this pull request as draft January 14, 2024 12:05
@fukusuket
Copy link
Author

fukusuket commented Jan 14, 2024

Test (issue #181)

Environment

  • macOS Sonoma 14.2.1
  • VSCode 1.85.1

before fix

I have confirmed that the reproduction of the problem before fixing it as follows.
スクリーンショット 2024-01-14 21 21 50

after fix

I have confirmed that there are no errors when exporting pdf and html as follows.
スクリーンショット 2024-01-14 21 26 45

@fukusuket
Copy link
Author

Test (other pattern)

after fix

I have confirmed that there are no errors when exporting pdf and html as follows.
スクリーンショット 2024-01-14 21 43 05

@fukusuket fukusuket marked this pull request as ready for review January 14, 2024 12:44
@fukusuket fukusuket changed the title fix: exclude URL patterns from markdown-it-include target fix: exclude URL(http/https/ftp) patterns from markdown-it-include target Jan 14, 2024
@danieldanielecki
Copy link

Plus one for that, very useful! without this PDF renders in such a way...
Screenshot 2024-10-23 at 17 24 06

@danieldanielecki
Copy link

@yzane !!

@wonbinkanglg
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants