Module: HTML2AsciiMath

Defined in:
lib/html2asciimath/ast.rb,
lib/html2asciimath.rb,
lib/html2asciimath/version.rb,
lib/html2asciimath/detector.rb,
lib/html2asciimath/converter.rb,
lib/html2asciimath/html_parser.rb,
lib/html2asciimath/html_text_parser.rb

Overview

© 2021 Ribose Inc.

Defined Under Namespace

Classes: AST, Converter, Detector, Error, HTMLParser, HTMLTextParser

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.convert(input) ⇒ Object



15
16
17
18
19
# File 'lib/html2asciimath.rb', line 15

def convert(input)
  str = input&.strip
  return str if str.nil? || str.empty?
  Converter.new(str).transform
end

.html_replace(input, &block) ⇒ Object



21
22
23
# File 'lib/html2asciimath.rb', line 21

def html_replace(input, &block)
  Detector.new(input).replace(&block)
end