From b1ecb05e29660a47ec574b0894b50989142cb4de Mon Sep 17 00:00:00 2001 From: Patrick Davey Date: Sun, 2 Apr 2023 18:27:34 +1200 Subject: [PATCH] fix for pygments and dark_pygments being required --- changelog.md | 3 +++ lib/vimwiki_markdown/template.rb | 6 +++++- lib/vimwiki_markdown/version.rb | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index d3d8633..4070930 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 0.9.1 [02 April 2023] +Bugfix that both pygments and dark_pygments placeholers were required. + ## 0.9.0 [02 April 2023] Add support for dark mode. Drop support for ruby < 2.7 diff --git a/lib/vimwiki_markdown/template.rb b/lib/vimwiki_markdown/template.rb index cae6b0e..c48bae6 100644 --- a/lib/vimwiki_markdown/template.rb +++ b/lib/vimwiki_markdown/template.rb @@ -27,7 +27,7 @@ def get_template_contents def fixtags(template) @template = template.gsub('%title%',title) - .gsub('%pygments%',pygments_wrapped_in_tags) + .gsub(pygments_marker,pygments_wrapped_in_tags) .gsub('%root_path%', root_path) .gsub('%date%', Date.today.strftime("%e %b %Y")) end @@ -54,6 +54,10 @@ def validate_template raise MissingRequiredParamError.new("ERROR: vimwiki template must contain %pygments% placeholder token. Please visit https://github.com/patrickdavey/vimwiki_markdown for more information") end + def pygments_marker + dark_template? ? "%dark_pygments%" : "%pygments%" + end + def dark_template? @template =~ /%dark_pygments%/ end diff --git a/lib/vimwiki_markdown/version.rb b/lib/vimwiki_markdown/version.rb index ea29ea0..52c2e39 100644 --- a/lib/vimwiki_markdown/version.rb +++ b/lib/vimwiki_markdown/version.rb @@ -1,3 +1,3 @@ module VimwikiMarkdown - VERSION = "0.9.0" + VERSION = "0.9.1" end