gollum 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

data/gollum.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.2.5'
8
+ s.version = '2.2.6'
9
9
  s.date = '2012-10-14'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
data/lib/gollum.rb CHANGED
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
  require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
24
24
 
25
25
  module Gollum
26
- VERSION = '2.2.5'
26
+ VERSION = '2.2.6'
27
27
 
28
28
  def self.assets_path
29
29
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
data/lib/gollum/markup.rb CHANGED
@@ -76,7 +76,7 @@ module Gollum
76
76
  doc,toc = process_headers(doc)
77
77
  @toc = @sub_page ? ( @parent_page ? @parent_page.toc_data : "[[_TOC_]]" ) : toc
78
78
  yield doc if block_given?
79
- data = doc.to_html
79
+ data = doc.to_xhtml
80
80
 
81
81
  data = process_toc_tags(data)
82
82
  data = process_tex(data)
@@ -95,16 +95,12 @@ module Gollum
95
95
  def process_headers(doc)
96
96
  toc = nil
97
97
  doc.css('h1,h2,h3,h4,h5,h6').each do |h|
98
- id = encodeURIComponent(h.content.gsub(' ','-'))
98
+ h_name = h.content.gsub(' ','-')
99
+
99
100
  level = h.name.gsub(/[hH]/,'').to_i
100
101
 
101
102
  # Add anchors
102
- anchor = Nokogiri::XML::Node.new('a', doc)
103
- anchor['class'] = 'anchor'
104
- anchor['id'] = id
105
- # % -> %25 so anchors work on Firefox. See issue #475
106
- anchor['href'] = '#' + id.gsub('%', '%25')
107
- h.add_child(anchor)
103
+ h.add_child(%Q{<a class="anchor" id="#{h_name}" href="##{h_name}"></a>})
108
104
 
109
105
  # Build TOC
110
106
  toc ||= Nokogiri::XML::DocumentFragment.parse('<div class="toc"><div class="toc-title">Table of Contents</div></div>')
@@ -122,7 +118,7 @@ module Gollum
122
118
  end
123
119
  node = Nokogiri::XML::Node.new('li', doc)
124
120
  # % -> %25 so anchors work on Firefox. See issue #475
125
- node.add_child(%Q{<a href="##{id.gsub("%", "%25")}">#{h.content}</a>})
121
+ node.add_child(%Q{<a href="##{h_name}">#{h.content}</a>})
126
122
  tail.add_child(node)
127
123
  end
128
124
  toc = toc.to_xhtml if toc != nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: