From 877cba9811a092e1ce7100ef3cf14e7f17f98804 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 17 Jan 2015 11:52:45 -0800 Subject: [PATCH] Remove direct baked-in support for Textile. --- Gemfile | 1 - lib/jekyll/converters/textile.rb | 56 -------------------------------- 2 files changed, 57 deletions(-) delete mode 100644 lib/jekyll/converters/textile.rb diff --git a/Gemfile b/Gemfile index 5649d19f..88d5e641 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,6 @@ gem 'redgreen', '~> 1.2' gem 'shoulda', '~> 3.5' gem 'rr', '~> 1.1' gem 'cucumber', '1.3.18' -gem 'RedCloth', '~> 4.2' gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 2.0' gem 'launchy', '~> 2.3' diff --git a/lib/jekyll/converters/textile.rb b/lib/jekyll/converters/textile.rb deleted file mode 100644 index c8137a3a..00000000 --- a/lib/jekyll/converters/textile.rb +++ /dev/null @@ -1,56 +0,0 @@ -module Jekyll - module Converters - class Textile < Converter - safe true - - highlighter_prefix '' - highlighter_suffix '' - - def setup - return if @setup - require 'redcloth' - @setup = true - rescue LoadError - STDERR.puts 'You are missing a library required for Textile. Please run:' - STDERR.puts ' $ [sudo] gem install RedCloth' - raise Errors::FatalException.new("Missing dependency: RedCloth") - end - - def extname_matches_regexp - @extname_matches_regexp ||= Regexp.new( - '(' + @config['textile_ext'].gsub(',','|') +')$', - Regexp::IGNORECASE - ) - end - - def matches(ext) - ext =~ extname_matches_regexp - end - - def output_ext(ext) - ".html" - end - - def convert(content) - setup - - # Shortcut if config doesn't contain RedCloth section - return RedCloth.new(content).to_html if @config['redcloth'].nil? - - # List of attributes defined on RedCloth - # (from https://github.com/jgarber/redcloth/blob/master/lib/redcloth/textile_doc.rb) - attrs = ['filter_classes', 'filter_html', 'filter_ids', 'filter_styles', - 'hard_breaks', 'lite_mode', 'no_span_caps', 'sanitize_html'] - - r = RedCloth.new(content) - - # Set attributes in r if they are NOT nil in the config - attrs.each do |attr| - r.instance_variable_set("@#{attr}".to_sym, @config['redcloth'][attr]) unless @config['redcloth'][attr].nil? - end - - r.to_html - end - end - end -end