lib/stripe.rb in flannel-0.0.1 vs lib/stripe.rb in flannel-0.1.0

- old
+ new

@@ -1,6 +1,7 @@ require 'wrappable' +require 'feed_parser' module Flannel class Stripe include Wrappable attr_reader :weave @@ -37,27 +38,36 @@ return @weave if preformatted @weave.gsub(/-\w(.*)\w>/) { |match| %{<a href="#{wiki_link match}">#{match[1..-2]}</a>}} end def to_h - text = build_wiki_links - markup text + if feed + parser = Flannel::FeedParser.new + parser.sub_feeds @weave + else + text = build_wiki_links + markup text + end end def preformatted @style == :preformatted end def list @style == :list end + + def feed + @style == :feed + end def markup text return html_escape text if preformatted tag = "li" if list wrap(text, tag) - end + end def html_escape text require 'cgi' CGI::escapeHTML(text)