Sha256: d2c836ce46203ca0462f30b9655b9ebeb5dfa4f5f1bff95f5636d671ea07f39b
Contents?: true
Size: 803 Bytes
Versions: 26
Compression:
Stored size: 803 Bytes
Contents
# Put any Ruby code in here. # Here's an example on how you can extend RedCloth (Textile) with new formatters. # # module RedCloth # module Formatters # module HTML # def attention(options) # %[<p class="attention">#{options[:text]}</p>] # end # end # end # end # # Then you can just use `attention. This is an important note!` on your text. # # You can add inline formatters as well. The approach is slightly different, # but pretty straightforward. # # Add your formatter to `RedCloth::INLINE_FORMATTERS` and implement the method, making sure that it # replaces the content using `String#gsub!`. # # module RedCloth # def my_formatter(text) # text.gsub!(/Hello/, "Hi") # end # end # # RedCloth::INLINE_FORMATTERS << :my_formatter #
Version data entries
26 entries across 15 versions & 2 rubygems