From 3d2d1a8be49f3d2db16618014d38d5b93ef0c58f Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 7 Sep 2011 18:32:57 -0500 Subject: 1. Vastly improved backtick code blocks and added support for Textile 2. Refactored Octopress filters into Liquid filters and pre/post render filters (using post_filters plugin) 3. Added methods to raw plugin to prevent Markdown and Textile from parsing blocks 4. Updated render partial to invoke the pre_render method of post_filters 5. Moved Rubypants filter out of default.html into Octopress post_render filters 6. Added raw's safe_wrapper method to codeblock and include_code filters --- plugins/raw.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'plugins/raw.rb') diff --git a/plugins/raw.rb b/plugins/raw.rb index 2deb5d10..4b002625 100644 --- a/plugins/raw.rb +++ b/plugins/raw.rb @@ -1,3 +1,19 @@ +# 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
+ def safe_wrap(input) + "
#{input}
" + end + # This must be applied after the + def unwrap(input) + input.gsub /
(.+?)<\/notextile><\/div>/m do + $1 + end + end +end + # Author: phaer, https://github.com/phaer # Source: https://gist.github.com/1020852 # Description: Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %} -- cgit v1.2.1