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 +1 -1
- data/lib/gollum.rb +1 -1
- data/lib/gollum/markup.rb +5 -9
- metadata +1 -1
data/gollum.gemspec
CHANGED
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.
|
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.
|
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
|
-
|
98
|
+
h_name = h.content.gsub(' ','-')
|
99
|
+
|
99
100
|
level = h.name.gsub(/[hH]/,'').to_i
|
100
101
|
|
101
102
|
# Add anchors
|
102
|
-
anchor =
|
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="##{
|
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
|