class Jekyll::MathJaxSourcesTag

Register the page with the {% mathjax_csp_sources %} Liquid tag for the second pass and temporarily emit a placeholder, later to be replaced by the list of MathJax-related CSP hashes

Attributes

final_source_list[RW]
second_pass[RW]
second_pass_docs[RW]
unrendered_docs[RW]

Public Class Methods

new(tag_name, text, tokens) click to toggle source
Calls superclass method
# File lib/jekyll-mathjax-csp.rb, line 172
def initialize(tag_name, text, tokens)
  super
end

Public Instance Methods

render(context) click to toggle source
# File lib/jekyll-mathjax-csp.rb, line 176
def render(context)
  page = context.registers[:page]
  if self.class.second_pass
    return self.class.final_source_list
  else
    self.class.second_pass_docs.add(page["path"])
    # Placeholder (hash corresponds to the empty script element)
    return "'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='"
  end
end