class Opmac2html::Preprocessor

A preprocessor for HTML and TeX special characters

Constants

G_SUBST
TEXT_SUBST
TS_REG

Attributes

ttchar[RW]

Public Class Methods

new() click to toggle source
# File lib/opmac2html/preprocessor.rb, line 14
def initialize
  @ttchar = '"'
end

Public Instance Methods

process_text(text) click to toggle source
# File lib/opmac2html/preprocessor.rb, line 22
def process_text(text)
  text.gsub(TS_REG) { |c| TEXT_SUBST[c] }
end
run(text) click to toggle source
# File lib/opmac2html/preprocessor.rb, line 18
def run(text)
  text.gsub(/[<>&]/) { |c| G_SUBST[c] }
end