Markdown: numero inicial em listas enumeradas

This commit is contained in:
2009-09-07 12:05:43 -03:00
parent c75c854a5d
commit 0d00ee07db
2 changed files with 7 additions and 5 deletions

View File

@@ -65,13 +65,13 @@ Rails::Initializer.run do |config|
config.action_view.sanitized_allowed_tags = %W(p h1 h2 h3 h4 h5 h6 dl dt ol config.action_view.sanitized_allowed_tags = %W(p h1 h2 h3 h4 h5 h6 dl dt ol
ul li address blockquote del div hr ins pre a abbr acronym dfn em strong ul li address blockquote del div hr ins pre a abbr acronym dfn em strong
code samp kbd var b i big small tt span br bdo cite del ins q sub sup img code samp kbd var b i big small tt span br bdo cite del ins q sub sup
map table tr td th colgroup col caption thead tbody tfoot) img map table tr td th colgroup col caption thead tbody tfoot)
config.action_view.sanitized_allowed_attributes = %W(align alt border config.action_view.sanitized_allowed_attributes = %W(align alt border
cellpadding cellspacing cols colspan coords height href longdesc name cellpadding cellspacing cols colspan coords height href longdesc name
noresize nowrap rel rows rowspan rules scope shape size span src style noresize nowrap rel rows rowspan rules scope shape size span src start
summary title type usemap valign width) style summary title type usemap valign width)
config.gem "dr_nic_magic_models" config.gem "dr_nic_magic_models"
config.gem "bluecloth" config.gem "bluecloth"

View File

@@ -568,10 +568,12 @@ class BlueCloth < String
@log.debug " Found list %p" % list @log.debug " Found list %p" % list
bullet = $1 bullet = $1
list_type = (ListMarkerUl.match(bullet) ? "ul" : "ol") list_type = (ListMarkerUl.match(bullet) ? "ul" : "ol")
list_start = (/([0-9]+)\./.match(bullet) ? " start='#{$1}'" : "")
list.gsub!( /\n{2,}/, "\n\n\n" ) list.gsub!( /\n{2,}/, "\n\n\n" )
%{<%s>\n%s</%s>\n} % [ %{<%s%s>\n%s</%s>\n} % [
list_type, list_type,
list_start,
transform_list_items( list, rs ), transform_list_items( list, rs ),
list_type, list_type,
] ]