Skip to content

Commit

Permalink
v1.0.4 - fixed issue with duplicate < (closes #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Helveg committed Feb 9, 2025
1 parent 47ca95f commit 0ca5851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jekyll-gfm-admonitions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Gem::Specification.new do |spec|
spec.name = 'jekyll-gfm-admonitions'
spec.version = '1.0.3'
spec.version = '1.0.4'
spec.authors = ['Robin De Schepper']
spec.email = ['[email protected]']

Expand Down
3 changes: 2 additions & 1 deletion lib/jekyll-gfm-admonitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def admonition_html(type, title, text, icon)
css = File.read(File.expand_path('../assets/admonitions.css', __dir__))

page.output.gsub!(%r{<head>(.*?)</head>}m) do |match|
"#{match[0..-7]}<style>#{CSSminify.compress(css)}</style>#{match[-7..]}"
head = Regexp.last_match(1)
"<head>#{head}<style>#{CSSminify.compress(css)}</style></head>"
end

# If no <head> tag is found, insert the CSS at the start of the output
Expand Down

0 comments on commit 0ca5851

Please sign in to comment.