Class: RedmineExtensions::HTMLFormatting::Formatter
- Inherits:
-
String
- Object
- String
- RedmineExtensions::HTMLFormatting::Formatter
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/redmine_extensions/html_formatting/formatter.rb
Constant Summary collapse
- RULES =
[:tidy_html_from_editor, :rinku_auto_link, :inline_auto_link, :inline_auto_mailto]
- AUTO_LINK_RE =
%r{ ( # leading text #<\w+.*?>| # leading HTML tag, or [^=<>!:'"/]| # leading punctuation, or \{\{\w+\(| # inside a macro? ^ # beginning of line ) ( (?:https?://)| # protocol spec, or (?:s?ftps?://)| (?:www\.)| # www.* (?:smb://)| (?:file://) ) ( (\S+?) # url (\/)? # slash ) ((?:>)?|[^\w\=\/;\(\)]*?) # post (?=<|\s| |$) }x
Instance Method Summary collapse
Instance Method Details
#to_html(*rules, &block) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/redmine_extensions/html_formatting/formatter.rb', line 8 def to_html(*rules, &block) ret = self.dup RULES.each do |rule_name| ret = (method(rule_name).call(ret) || ret) end ret end |