lib/kitabu/extensions/redcloth.rb in kitabu-1.0.1 vs lib/kitabu/extensions/redcloth.rb in kitabu-1.0.2

- old
+ new

@@ -5,18 +5,22 @@ new(text).to_html(*INLINE_FORMATTERS) end module Inline FN_RE = / - (\s+)? # getting spaces - %\{ # opening - (.*?) # footnote - \}# # closing + (\s+)? # getting spaces + (\\)?%\{ # opening + (.*?) # footnote + \}# # closing /xm def footnote(text) text.gsub!(FN_RE) do |m| - %(<span class="footnote">#{$2}</span>) + if $2 + %[#{$1}%{#{$3}}] + else + %(<span class="footnote">#{$3}</span>) + end end end LINK_RE = / <