Class: Thredded::MarkdownKatex::EmailTransformer

Inherits:
EmailTransformer::Base
  • Object
show all
Defined in:
lib/thredded/markdown_katex/email_transformer.rb

Overview

Replaces Katex blocks with their ‘<math>` content and makes them visible, because most email clients do not support webfonts, and webfonts are required for the non-`<math>` version.

Instance Method Summary collapse

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'lib/thredded/markdown_katex/email_transformer.rb', line 10

def call
  doc.css('.katex').each do |katex|
    math = katex.at('math')
    math.remove_attribute('class')
    katex.swap math
  end
end