Class: String

### Home Classes Methods

### In Files

- lib/maruku/ext/math/latex_fix.rb
- lib/maruku/input/type_detection.rb
- lib/maruku/input_textile2/t2_parser.rb
- lib/maruku/output/to_html.rb
- lib/maruku/output/to_latex_strings.rb
- lib/maruku/output/to_markdown.rb
- lib/maruku/structures_inspect.rb

### Parent

Object

### Methods

- #escape_to_latex
- #fix_latex
- #inspect_more
- #md_type
- #mysplit
- #t2_contains_signature?
- #t2_empty?
- #t2_get_signature
- #to_html
- #to_latex
- #to_md

### Included Modules

- MaRuKu::Strings

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# String

### Constants

LATEX_ADD_SLASH

  These are TeX's special characters

LATEX_TO_CHARCODE

  These, we transform to {tt char<ascii code>}

OtherGoodies

  other things that are good on the eyes

Textile2_EmptyLine
Textile2_Signature

### Public Instance Methods

escape_to_latex(s) click to toggle source

    # File lib/maruku/output/to_latex_strings.rb, line 31
    def escape_to_latex(s)
            s2 = ""
            s.each_byte do |b|
                    if LATEX_TO_CHARCODE.include? b
                            s2 += "{\\tt \\char#{b}}"
                    elsif LATEX_ADD_SLASH.include? b
                            s2 << \\\ << b
                    elsif b == \\\
                    # there is no backslash in cmr10 fonts
                            s2 += "$\\backslash$"
                    else
                            s2 << b
                    end
            end
            s2
    end

fix_latex() click to toggle source

fix some LaTeX command-name clashes

    # File lib/maruku/ext/math/latex_fix.rb, line 3
    def fix_latex
            if #{html_math_engine} == 'itex2mml'
                    s = self.gsub("\\mathop{", "\\operatorname{")
                    s.gsub!(/\\begin\{svg\}.*?\\end\{svg\}/, " ")
                    s.gsub("\\space{", "\\itexspace{")
            else
                    self
            end
    end

inspect_more(a=nil,b=nil) click to toggle source

    # File lib/maruku/structures_inspect.rb, line 24
    def inspect_more(a=nil,b=nil)
            inspect
    end

md_type() click to toggle source

    # File lib/maruku/input/type_detection.rb, line 23
    def md_type()
            @md_type ||= line_md_type(self)
    end

mysplit() click to toggle source

" andrea censi " => [" andrea ", "censi "]

    # File lib/maruku/output/to_markdown.rb, line 29
    def mysplit
            split.map{|x| x+" "}
    end

t2_contains_signature?() click to toggle source

    # File lib/maruku/input_textile2/t2_parser.rb, line 9
    def t2_contains_signature?
            self =~ Textile2_Signature
    end

t2_empty?() click to toggle source

    # File lib/maruku/input_textile2/t2_parser.rb, line 5
    def t2_empty?
            self =~ Textile2_EmptyLine
    end

t2_get_signature() click to toggle source

sig, rest = t2_get_signature

    # File lib/maruku/input_textile2/t2_parser.rb, line 14
    def t2_get_signature
            self =~ Textile2_Signature
            return Textile2Signature.new($1), $2
    end

to_html() click to toggle source

A string is rendered into HTML by creating a REXML::Text node. REXML takes care of all the encoding.

    # File lib/maruku/output/to_html.rb, line 34
    def to_html
            REXML::Text.new(self)
    end

to_latex() click to toggle source

escapes special characters

    # File lib/maruku/output/to_latex_strings.rb, line 49
    def to_latex
            s = escape_to_latex(self)
            OtherGoodies.each do |k, v|
                    s.gsub!(k, v)
            end
            s
    end

to_md(c=nil) click to toggle source

XXX: markdown escaping

    # File lib/maruku/output/to_markdown.rb, line 24
    def to_md(c=nil)
            to_s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.