Update character set

This commit is contained in:
cryptogopher 2023-05-27 21:12:39 +02:00
parent 19ab22b675
commit c098a9b024

View File

@ -6,15 +6,15 @@
module JekyllTagsExtensions
module HighlightCaption
def self.prepended(mod)
syntax = mod.send(:remove_const, :SYNTAX).source.gsub('\\w', '[^[:^graph:]"]')
syntax = mod.send(:remove_const, :SYNTAX).source.gsub('\\w', '[^[:^graph:]"=]')
mod.const_set(:SYNTAX, Regexp.new(syntax))
options = mod.send(:remove_const, :OPTIONS_REGEX).source.gsub('\\w', '[^[:^graph:]"]')
options = mod.send(:remove_const, :OPTIONS_REGEX).source.gsub('\\w', '[^[:^graph:]"=]')
mod.const_set(:OPTIONS_REGEX, Regexp.new(options))
end
def render(*args)
caption = "<figcaption>"
caption << "<span class=\"lang\">#{@lang.upcase}#{@highlight_options[:caption] ? ":" : ""}</span>"
caption = "<figcaption><span class=\"lang\">"
caption << "#{@lang.upcase}#{@highlight_options[:caption] ? ':' : ''}</span>"
if @highlight_options[:caption].is_a? String
caption << "<em>#{@highlight_options[:caption]}</em>"
end