diff --git a/README.rdoc b/README.rdoc index c63aedd..8e76fe7 100644 --- a/README.rdoc +++ b/README.rdoc @@ -12,9 +12,19 @@ License:: MIT RedCloth is a Ruby library for converting Textile into HTML. -== Attention - Deprecating JRuby and Windows support in version 4.3 +== Attention: **BREAKING CHANGE** RedCloth 5.x series -In order to prioritize merging a fix for the long standing vulnerability *CVE-2012-6684*, our {new maintainer}[https://github.com/joshuasiler] has elected to stop maintaining the precompiled versions for Windows and JRuby. +RedCloth 5.x series will not create the the t alias by default, but will provide an extension file if you wish to continue that behavior. + +Keep in mind the long term plan is to drop this all together. + +== JRuby and Windows support in version 4.3 + +A while ago, around the time *CVE-2012-6684* was open, the {maintainer at that time}[https://github.com/joshuasiler], has elected to stop maintaining the precompiled versions for Windows and JRuby. + +But there is an ongoing effort to restore JRuby support. + +If this interests you, please :+1: {Issue #44}[https://github.com/jgarber/redcloth/issues/44]. == Installing diff --git a/lib/redcloth.rb b/lib/redcloth.rb index 376d022..9f92cf9 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -28,23 +28,16 @@ require 'redcloth/formatters/latex' module RedCloth - + # A convenience method for creating a new TextileDoc. See # RedCloth::TextileDoc. def self.new( *args, &block ) RedCloth::TextileDoc.new( *args, &block ) end - + # Include extension modules (if any) in TextileDoc. def self.include(*args) RedCloth::TextileDoc.send(:include, *args) end - -end -begin - require 'erb' - require 'redcloth/erb_extension' - include ERB::Util -rescue LoadError end diff --git a/lib/redcloth/erb_alias_extension.rb b/lib/redcloth/erb_alias_extension.rb new file mode 100644 index 0000000..8c8006f --- /dev/null +++ b/lib/redcloth/erb_alias_extension.rb @@ -0,0 +1,15 @@ + +require 'erb' +require 'redcloth/erb_extension' + +class ERB + module Util + alias t textilize + module_function :t + end +end + +begin + include ERB::Util +rescue LoadError +end diff --git a/lib/redcloth/erb_extension.rb b/lib/redcloth/erb_extension.rb index a30486e..edc17ab 100644 --- a/lib/redcloth/erb_extension.rb +++ b/lib/redcloth/erb_extension.rb @@ -19,8 +19,6 @@ def textilize( s ) end end - alias t textilize - module_function :t module_function :textilize end diff --git a/redcloth.gemspec b/redcloth.gemspec index 3231cf1..bb2fba2 100644 --- a/redcloth.gemspec +++ b/redcloth.gemspec @@ -43,4 +43,10 @@ Gem::Specification.new do |s| s.add_development_dependency('rspec', '~> 3.12') s.add_development_dependency('diff-lcs', '~> 1.5') + s.post_install_message = %q{ + **BREAKING CHANGE**: RedCloth 5.x series + RedCloth 5.x series has one breaking change related to alias `t` + Please see https://github.com/jgarber/redcloth#attention-breaking-change-redcloth-5x-series- + } + end \ No newline at end of file diff --git a/spec/erb_spec.rb b/spec/erb_spec.rb index 71c11b6..97c222b 100644 --- a/spec/erb_spec.rb +++ b/spec/erb_spec.rb @@ -1,4 +1,5 @@ require File.dirname(__FILE__) + '/spec_helper' +require 'redcloth/erb_alias_extension' describe "ERB helper" do it "should add a textile tag to ERB" do