From 0d00ee07db88696ff427ebcd5f9d28d3320f2d7f Mon Sep 17 00:00:00 2001 From: Alinson Santos Date: Mon, 7 Sep 2009 12:05:43 -0300 Subject: [PATCH] Markdown: numero inicial em listas enumeradas --- config/environment.rb | 8 ++++---- vendor/gems/bluecloth-1.0.0/lib/bluecloth.rb | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/environment.rb b/config/environment.rb index a291507..288a9ba 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -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 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 - map table tr td th colgroup col caption thead tbody tfoot) + code samp kbd var b i big small tt span br bdo cite del ins q sub sup + img map table tr td th colgroup col caption thead tbody tfoot) config.action_view.sanitized_allowed_attributes = %W(align alt border cellpadding cellspacing cols colspan coords height href longdesc name - noresize nowrap rel rows rowspan rules scope shape size span src style - summary title type usemap valign width) + noresize nowrap rel rows rowspan rules scope shape size span src start + style summary title type usemap valign width) config.gem "dr_nic_magic_models" config.gem "bluecloth" diff --git a/vendor/gems/bluecloth-1.0.0/lib/bluecloth.rb b/vendor/gems/bluecloth-1.0.0/lib/bluecloth.rb index 6bb6aed..8d0e705 100644 --- a/vendor/gems/bluecloth-1.0.0/lib/bluecloth.rb +++ b/vendor/gems/bluecloth-1.0.0/lib/bluecloth.rb @@ -568,10 +568,12 @@ class BlueCloth < String @log.debug " Found list %p" % list bullet = $1 list_type = (ListMarkerUl.match(bullet) ? "ul" : "ol") + list_start = (/([0-9]+)\./.match(bullet) ? " start='#{$1}'" : "") list.gsub!( /\n{2,}/, "\n\n\n" ) - %{<%s>\n%s\n} % [ + %{<%s%s>\n%s\n} % [ list_type, + list_start, transform_list_items( list, rs ), list_type, ]