jekyll-reposter 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "jekyll-reposter"
7
- s.version = "0.1.7"
7
+ s.version = "0.1.8"
8
8
  s.authors = ["Stefan Wienert"]
9
9
  s.email = ["stefan.wienert@pludoni.de"]
10
10
  s.homepage = "https://github.com/zealot128/jekyll-reposter"
@@ -19,7 +19,7 @@ module Jekyll
19
19
  @options = {
20
20
  :tags => "[notes, external]",
21
21
  :dir => "source/_posts",
22
- :allowed_tags => %w[h2 ul li ol h3 h4 h5 code pre quote blockquote cite hr],
22
+ :allowed_tags => %w[h2 ul li ol h3 h4 h5 code pre quote blockquote cite hr a img strong b em i],
23
23
  :meta => {
24
24
  "comments" => true,
25
25
  "layout" => "post"
@@ -36,8 +36,17 @@ module Jekyll
36
36
  "</ul>" => "",
37
37
  "<ul>" => "",
38
38
  "<pre>" => "\n\n```ruby\n",
39
- "</pre>" => "```\n\n",
40
- /[\t ]+<li>/ => "* "
39
+ "</pre>" => "\n```\n\n",
40
+ "<code>" => "\n\n```ruby\n",
41
+ "</code>" => "\n```\n\n",
42
+ /[\t ]*<li>/ => "* ",
43
+ /[\t ]*<h3>/ => "\n###",
44
+ /<\/h3>/ => "\n",
45
+ /[\t ]*<h2>/ => "\n##",
46
+ /<\/h2>/ => "\n",
47
+ "\t" => " ",
48
+
49
+
41
50
  }
42
51
 
43
52
  @feed = Feedzirra::Feed.fetch_and_parse(feed)
@@ -66,7 +75,8 @@ module Jekyll
66
75
  # stringex ignores "->", url error at webrick
67
76
  unless File.exists? filename
68
77
  main_part = entry.content || entry.summary
69
- content = Sanitize.clean main_part, :elements => @options[:allowed_tags]
78
+ content = Sanitize.clean main_part, :elements => @options[:allowed_tags],
79
+ :attributes => {'a' => ['href', 'title'], "img" => ["alt","src"]}
70
80
 
71
81
  @replacings.each do |from,to|
72
82
  content.gsub! from, to
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-reposter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: feedzirra
16
- requirement: &77946430 !ruby/object:Gem::Requirement
16
+ requirement: &85225550 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *77946430
24
+ version_requirements: *85225550
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: curb
27
- requirement: &77946130 !ruby/object:Gem::Requirement
27
+ requirement: &85225270 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.8'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *77946130
35
+ version_requirements: *85225270
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: stringex
38
- requirement: &77945860 !ruby/object:Gem::Requirement
38
+ requirement: &85224980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *77945860
46
+ version_requirements: *85224980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sanitize
49
- requirement: &77945610 !ruby/object:Gem::Requirement
49
+ requirement: &85224740 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *77945610
57
+ version_requirements: *85224740
58
58
  description: Provides a interface for generating posts as a repost from external feeds.
59
59
  Tested with octopress.
60
60
  email: