jsjohnst-jekyll 0.4.1.999.1 → 0.4.1.999.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ module Jekyll
2
+ class MarkdownBlock < Liquid::Block
3
+ include Liquid::StandardFilters
4
+ def render(context)
5
+ Maruku.new(super(context).join).to_html
6
+ end
7
+ end
8
+ end
9
+
10
+ Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)
@@ -0,0 +1,23 @@
1
+ require 'jekyll/filters'
2
+
3
+ module Jekyll
4
+ class SmartypantsBlock < Liquid::Block
5
+ include Liquid::StandardFilters
6
+ def render(context)
7
+ Smartypants.educate_string(super(context).join)
8
+ end
9
+ end
10
+
11
+ # Maruku, inexplicably, offers no way to access its Smartypants
12
+ # implementation outside of the Markdown interface. So here's a hack.
13
+ class Smartypants; end
14
+ class << Smartypants
15
+ include MaRuKu::In::Markdown::SpanLevelParser
16
+ include MaRuKu::Helpers
17
+ def educate_string(s)
18
+ educate([s]).map{ |x| x.to_html_entity rescue x }.join
19
+ end
20
+ end
21
+ end
22
+
23
+ Liquid::Template.register_tag('educate', Jekyll::SmartypantsBlock)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsjohnst-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1.999.1
4
+ version: 0.4.1.999.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -115,6 +115,8 @@ files:
115
115
  - lib/jekyll/tags
116
116
  - lib/jekyll/tags/highlight.rb
117
117
  - lib/jekyll/tags/include.rb
118
+ - lib/jekyll/tags/markdown.rb
119
+ - lib/jekyll/tags/smartypants.rb
118
120
  - lib/jekyll/tasks.rb
119
121
  - lib/jekyll.rb
120
122
  - test/helper.rb