Sha256: 097008e7b92f2e10a512765cf0f13322d8ef7deaa52bf6d2d0b72a92dd1d79f0

Contents?: true

Size: 608 Bytes

Versions: 2

Compression:

Stored size: 608 Bytes

Contents

# Author: Brandon Mathis
# Description: Provides plugins with a method for wrapping and unwrapping input to prevent Markdown and Textile from parsing it.
# Purpose: This is useful for preventing Markdown and Textile from being too aggressive and incorrectly parsing in-line HTML.
module TemplateWrapper
  # Wrap input with a <div>
  def self.safe_wrap(input)
    "<div class='bogus-wrapper'><notextile>#{input}</notextile></div>"
  end
  # This must be applied after the
  def self.unwrap(input)
    input.gsub /<div class='bogus-wrapper'><notextile>(.+?)<\/notextile><\/div>/m do
      $1
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-lenciel-theme-1.0.29 plugins/raw.rb
jekyll-lenciel-theme-1.0.28 plugins/raw.rb