0
-require 'redcloth_scan'
0
$:.unshift(File.dirname(__FILE__))
0
-require 'formatters/base'
0
-require 'formatters/html'
0
-require 'formatters/latex'
0
- # Accessors for setting security restrictions.
0
- # This is a nice thing if you're using RedCloth for
0
- # formatting in public places (e.g. Wikis) where you
0
- # don't want users to abuse HTML for bad things.
0
- # If +:filter_html+ is set, HTML which wasn't
0
- # created by the Textile processor will be escaped.
0
- # Alternatively, if +:sanitize_html+ is set,
0
- # HTML can pass through the Textile processor but
0
- # unauthorized tags and attributes will be removed.
0
- # If +:filter_styles+ is set, it will also disable
0
- # the style markup specifier. ('{color: red}')
0
- # If +:filter_classes+ is set, it will also disable
0
- # class attributes. ('!(classname)image!')
0
- # If +:filter_ids+ is set, it will also disable
0
- # id attributes. ('!(classname#id)image!')
0
- attr_accessor :filter_html, :sanitize_html, :filter_styles, :filter_classes, :filter_ids
0
- # Deprecated accessor for toggling hard breaks.
0
- # Traditional RedCloth converted single newlines
0
- # to HTML break tags, but later versions required
0
- # +:hard_breaks+ be set to enable this behavior.
0
- # +:hard_breaks+ is once again the default. The
0
- # accessor is deprecated and will be removed in a
0
- attr_accessor :hard_breaks
0
- # Accessor for toggling lite mode.
0
- # In lite mode, block-level rules are ignored. This means
0
- # that tables, paragraphs, lists, and such aren't available.
0
- # Only the inline markup for bold, italics, entities and so on.
0
- # r = RedCloth.new( "And then? She *fell*!", [:lite_mode] )
0
- # #=> "And then? She <strong>fell</strong>!"
0
- attr_accessor :lite_mode
0
+require 'redcloth_scan'
0
+require 'redcloth/version'
0
+require 'redcloth/textile_doc'
0
+require 'redcloth/formatters/base'
0
+require 'redcloth/formatters/html'
0
+require 'redcloth/formatters/latex'
0
- # Accessor for toggling span caps.
0
- # Textile places `span' tags around capitalized
0
- # words by default, but this wreaks havoc on Wikis.
0
- # If +:no_span_caps+ is set, this will be
0
- attr_accessor :no_span_caps
0
- # Returns a new RedCloth object, based on _string_, observing
0
- # any _restrictions_ specified.
0
- # r = RedCloth.new( "h1. A *bold* man" )
0
- # #=> "h1. A *bold* man"
0
- # #=>"<h1>A <b>bold</b> man</h1>"
0
- def initialize( string, restrictions = [] )
0
- restrictions.each { |r| method("#{r}=").call( true ) }
0
+ # A convenience method for creating a new TextileDoc. See
0
+ # RedCloth::TextileDoc.
0
+ def self.new( *args, &block )
0
+ RedCloth::TextileDoc.new( *args, &block )
0
- # Generates HTML from the Textile contents.
0
- # RedCloth.new( "And then? She *fell*!" ).to_html
0
- # #=>"<p>And then? She <strong>fell</strong>!</p>"
0
- to(RedCloth::Formatters::HTML)
0
- # Generates LaTeX from the Textile contents.
0
- # RedCloth.new( "And then? She *fell*!" ).to_latex
0
- # #=> "And then? She \\textbf{fell}!\n\n"
0
- def to_latex( *rules )
0
- to(RedCloth::Formatters::LATEX)
0
- def apply_rules(rules)
0
- method(r).call(self) if self.respond_to?(r)
0
+ # Include extension modules (if any) in TextileDoc.
0
+ def self.include(*args)
0
+ RedCloth::TextileDoc.send(:include, *args)
Comments
No one has commented yet.