Sha256: 0263feff18a3037957eff21a9d24c0a56f8ff2aacea97daf1cc335b480801e27

Contents?: true

Size: 427 Bytes

Versions: 12

Compression:

Stored size: 427 Bytes

Contents

require 'wikitext'

# This allows a us to create a wrapper object similar to those provided by the
# Markdown and Textile libraries. It stores the original and formated HTML text
# in instance variables.
# 
class WikitextString < String
  attr_reader :text
  attr_reader :html
  
  def initialize(str)
    super(str)
    @text = str.to_s
    @html = Wikitext::Parser.new.parse(@text)
  end
  
  def to_html
    @html
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
vigetlabs-acts_as_markup-1.0.0 lib/acts_as_markup/exts/wikitext.rb
vigetlabs-acts_as_markup-1.1.0 lib/acts_as_markup/exts/wikitext.rb
vigetlabs-acts_as_markup-1.1.1 lib/acts_as_markup/exts/wikitext.rb
vigetlabs-acts_as_markup-1.1.2 lib/acts_as_markup/exts/wikitext.rb
vigetlabs-acts_as_markup-1.2.0 lib/acts_as_markup/exts/wikitext.rb
vigetlabs-acts_as_markup-1.2.1 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.0.0 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.2.0 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.1.1 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.1.0 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.2.1 lib/acts_as_markup/exts/wikitext.rb
acts_as_markup-1.1.2 lib/acts_as_markup/exts/wikitext.rb