Skip to content

Commit

Permalink
fix for pygments and dark_pygments being required
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdavey committed Apr 2, 2023
1 parent c7d48ea commit b1ecb05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 5 additions & 1 deletion lib/vimwiki_markdown/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/vimwiki_markdown/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VimwikiMarkdown
VERSION = "0.9.0"
VERSION = "0.9.1"
end

0 comments on commit b1ecb05

Please sign in to comment.