Class: Redmine::WikiFormatting::Textile::Formatter

Inherits:
RedCloth3 show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/redmine/wiki_formatting/textile/formatter.rb

Constant Summary

RULES =

auto_link rule after textile rules so that it doesn’t break !image_url! tags

[:textile, :block_markdown_rule, :inline_auto_link, :inline_auto_mailto, :inline_toc]
%r{
 (                          # leading text
   <\w+.*?>|                # leading HTML tag, or
   [^=<>!:'"/]|             # leading punctuation, or 
   ^                        # beginning of line
 )
 (
   (?:https?://)|           # protocol spec, or
   (?:s?ftps?://)|
   (?:www\.)                # www.*
 )
 (
   (\S+?)                   # url
   (\/)?                    # slash
 )
 ([^\w\=\/;\(\)]*?)               # post
 (?=<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE)

Constants inherited from RedCloth3

A, ALLOWED_TAGS, ALLTAG_MATCH, ATX_RE, A_HLGN, A_VLGN, BASIC_TAGS, BLOCKS_GROUP_RE, BLOCK_RE, C, CODE_RE, C_CLAS, C_LNGE, C_STYL, DEFAULT_RULES, GLYPHS, HASTAG_MATCH, HYPERLINK, H_ALGN_VALS, IMAGE_RE, LINK_RE, LISTS_CONTENT_RE, LISTS_RE, MARKDOWN_BQ_RE, MARKDOWN_LINK_RE, MARKDOWN_REFLINK_RE, MARKDOWN_REFS_RE, MARKDOWN_RULE_RE, OFFTAGS, OFFTAG_CLOSE, OFFTAG_MATCH, OFFTAG_OPEN, PUNCT, PUNCT_NOQ, PUNCT_Q, QTAGS, QTAGS_JOIN, QUOTES_CONTENT_RE, QUOTES_RE, S, SETEXT_RE, SIMPLE_HTML_TAGS, S_CSPN, S_RSPN, TABLE_RE, TEXTILE_REFS_RE, TEXTILE_TAGS, VERSION, V_ALGN_VALS

Instance Method Summary

Methods inherited from String

#gunzip, #gunzip!, #gzip, #gzip!, #parse_csv, #read_ber, #to_ber, #to_ber_application_string, #to_ber_contextspecific, #to_unix, #with_leading_slash

Methods included from Diffable

#diff, #patch, #replacenextlarger, #reverse_hash

Methods included from Redmine::CoreExtensions::String::Conversions

#to_a, #to_hours

Methods included from Redmine::CoreExtensions::String::Inflections

#with_leading_slash

Constructor Details

- (Formatter) initialize(*args)

A new instance of Formatter



29
30
31
32
33
34
# File 'lib/redmine/wiki_formatting/textile/formatter.rb', line 29

def initialize(*args)
  super
  self.hard_breaks=true
  self.no_span_caps=true
  self.filter_styles=true
end

Instance Method Details

- (Object) to_html(*rules)



36
37
38
39
# File 'lib/redmine/wiki_formatting/textile/formatter.rb', line 36

def to_html(*rules)
  @toc = []
  super(*RULES).to_s
end