webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.71k stars 416 forks source link

Regexp escape for `!` is missing and causes missing images #473

Closed MartenBE closed 8 months ago

MartenBE commented 8 months ago

See https://github.com/webpro/reveal-md/commit/be811016c12ac9be30c579fffe39fb67e6ebf6b2#commitcomment-136249062

webpro commented 8 months ago

The ! is not a special regex character? My linter was complaining about it being unnecessarily escaped.

vvscode commented 8 months ago

looks like we need some screenshot tests =)

MartenBE commented 8 months ago

Sorry, there is a mistake in the regex I introduced, but it is not the ! char, it is the following: the regexp currently only copies images with an alt explanatation because I used + instead of * in the regexp:

Current regexp: const htmlImageRE = /!\[.+?\]\((.+?)\)/g; Should be: const htmlImageRE = /!\[.*?\]\((.+?)\)/g;

MartenBE commented 8 months ago

PR created at https://github.com/webpro/reveal-md/pull/474

webpro commented 8 months ago

No need to apologize! Thanks for the fix.