gollum-site 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,34 @@
1
1
  module Gollum
2
2
  class Markup
3
+ # Removing sanitization; this will be configurable after Gollum 1.1.0
4
+ def render(no_follow = false)
5
+ sanitize_options = no_follow ?
6
+ HISTORY_SANITIZATION_OPTIONS :
7
+ SANITIZATION_OPTIONS
8
+ data = extract_tex(@data)
9
+ data = extract_code(data)
10
+ data = extract_tags(data)
11
+ begin
12
+ data = GitHub::Markup.render(@name, data)
13
+ if data.nil?
14
+ raise "There was an error converting #{@name} to HTML."
15
+ end
16
+ rescue Object => e
17
+ data = %{<p class="gollum-error">#{e.message}</p>}
18
+ end
19
+ data = process_tags(data)
20
+ data = process_code(data)
21
+ sanitize_options[:elements] << 'iframe'
22
+ sanitize_options[:attributes][:all] << 'frameborder'
23
+ data = Sanitize.clean(data, sanitize_options)
24
+ data = process_tex(data)
25
+ data.gsub!(/<p><\/p>/, '')
26
+ data
27
+ end
3
28
 
4
29
  # Attempt to process the tag as a page link tag.
5
30
  #
6
- # tag - The String tag contents (the stuff inside the double
31
+ # tag - The String tag contents (the stuff inside the double
7
32
  # brackets).
8
33
  # no_follow - Boolean that determines if rel="nofollow" is added to all
9
34
  # <a> tags.
@@ -14,7 +14,9 @@ module Gollum
14
14
  # need to change class name in markup.rb
15
15
  #:markup_class => Gollum::SiteMarkup,
16
16
  :page_class => Gollum::SitePage,
17
- :base_path => options[:base_path]
17
+ :base_path => options[:base_path],
18
+ :sanitization => false,
19
+ :history_sanitization => false
18
20
  })
19
21
  @wiki.site = self
20
22
  @output_path = options[:output_path] || "_site"
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  class Site
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-site
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Reverri
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 -08:00
18
+ date: 2010-12-20 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency