|
|
@ -31,7 +31,7 @@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# == Sample Textile Text
|
|
|
|
# == Sample Textile Text
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# h3. This is a title
|
|
|
|
# h2. This is a title
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# h3. This is a subhead
|
|
|
|
# h3. This is a subhead
|
|
|
|
#
|
|
|
|
#
|
|
|
@ -129,7 +129,7 @@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Will become:
|
|
|
|
# Will become:
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# <acronym title="American Civil Liberties Union">ACLU</acronym>
|
|
|
|
# <abbr title="American Civil Liberties Union">ACLU</abbr>
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# == Adding Tables
|
|
|
|
# == Adding Tables
|
|
|
|
#
|
|
|
|
#
|
|
|
@ -152,7 +152,7 @@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# doc = RedCloth.new "
|
|
|
|
# doc = RedCloth.new "
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# h3. Test document
|
|
|
|
# h2. Test document
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Just a simple test."
|
|
|
|
# Just a simple test."
|
|
|
|
#
|
|
|
|
#
|
|
|
@ -227,7 +227,7 @@ class RedCloth3 < String
|
|
|
|
# refs_textile:: Textile references (i.e. [hobix]http://hobix.com/)
|
|
|
|
# refs_textile:: Textile references (i.e. [hobix]http://hobix.com/)
|
|
|
|
# block_textile_table:: Textile table block structures
|
|
|
|
# block_textile_table:: Textile table block structures
|
|
|
|
# block_textile_lists:: Textile list structures
|
|
|
|
# block_textile_lists:: Textile list structures
|
|
|
|
# block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h3., etc.)
|
|
|
|
# block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.)
|
|
|
|
# inline_textile_image:: Textile inline images
|
|
|
|
# inline_textile_image:: Textile inline images
|
|
|
|
# inline_textile_link:: Textile inline links
|
|
|
|
# inline_textile_link:: Textile inline links
|
|
|
|
# inline_textile_span:: Textile inline spans
|
|
|
|
# inline_textile_span:: Textile inline spans
|
|
|
@ -457,7 +457,7 @@ class RedCloth3 < String
|
|
|
|
# text.gsub! re, resub
|
|
|
|
# text.gsub! re, resub
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
text.gsub!(/\b([A-Z][A-Z0-9]{1,})\b(?:[(]([^)]*)[)])/) do |m|
|
|
|
|
text.gsub!(/\b([A-Z][A-Z0-9]{1,})\b(?:[(]([^)]*)[)])/) do |m|
|
|
|
|
"<acronym title=\"#{htmlesc $2}\">#{$1}</acronym>"
|
|
|
|
"<abbr title=\"#{htmlesc $2}\">#{$1}</abbr>"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -525,7 +525,7 @@ class RedCloth3 < String
|
|
|
|
tatts = pba( tatts, 'table' )
|
|
|
|
tatts = pba( tatts, 'table' )
|
|
|
|
tatts = shelve( tatts ) if tatts
|
|
|
|
tatts = shelve( tatts ) if tatts
|
|
|
|
rows = []
|
|
|
|
rows = []
|
|
|
|
|
|
|
|
fullrow.gsub!(/([^|])\n/, "\\1<br />")
|
|
|
|
fullrow.each_line do |row|
|
|
|
|
fullrow.each_line do |row|
|
|
|
|
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
|
|
|
|
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
|
|
|
|
cells = []
|
|
|
|
cells = []
|
|
|
@ -699,7 +699,7 @@ class RedCloth3 < String
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
alias textile_h1 textile_p
|
|
|
|
alias textile_h1 textile_p
|
|
|
|
alias textile_h3 textile_p
|
|
|
|
alias textile_h2 textile_p
|
|
|
|
alias textile_h3 textile_p
|
|
|
|
alias textile_h3 textile_p
|
|
|
|
alias textile_h4 textile_p
|
|
|
|
alias textile_h4 textile_p
|
|
|
|
alias textile_h5 textile_p
|
|
|
|
alias textile_h5 textile_p
|
|
|
@ -733,7 +733,7 @@ class RedCloth3 < String
|
|
|
|
SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
|
|
|
|
SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
|
|
|
|
def block_markdown_setext( text )
|
|
|
|
def block_markdown_setext( text )
|
|
|
|
if text =~ SETEXT_RE
|
|
|
|
if text =~ SETEXT_RE
|
|
|
|
tag = if $2 == "="; "h1"; else; "h3"; end
|
|
|
|
tag = if $2 == "="; "h1"; else; "h2"; end
|
|
|
|
blk, cont = "<#{ tag }>#{ $1 }</#{ tag }>", $'
|
|
|
|
blk, cont = "<#{ tag }>#{ $1 }</#{ tag }>", $'
|
|
|
|
blocks cont
|
|
|
|
blocks cont
|
|
|
|
text.replace( blk + cont )
|
|
|
|
text.replace( blk + cont )
|
|
|
@ -1166,7 +1166,7 @@ class RedCloth3 < String
|
|
|
|
'li' => nil,
|
|
|
|
'li' => nil,
|
|
|
|
'p' => nil,
|
|
|
|
'p' => nil,
|
|
|
|
'h1' => nil,
|
|
|
|
'h1' => nil,
|
|
|
|
'h3' => nil,
|
|
|
|
'h2' => nil,
|
|
|
|
'h3' => nil,
|
|
|
|
'h3' => nil,
|
|
|
|
'h4' => nil,
|
|
|
|
'h4' => nil,
|
|
|
|
'h5' => nil,
|
|
|
|
'h5' => nil,
|
|
|
|