gollum-lib 5.1.1-java → 5.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +7 -0
- data/HISTORY.md +7 -3
- data/README.md +1 -1
- data/Rakefile +80 -23
- data/gemspec.rb +5 -9
- data/lib/gollum-lib/filter/code.rb +23 -4
- data/lib/gollum-lib/filter/macro.rb +3 -3
- data/lib/gollum-lib/filter/plantuml.rb +1 -1
- data/lib/gollum-lib/filter/render.rb +5 -2
- data/lib/gollum-lib/filter/toc.rb +4 -4
- data/lib/gollum-lib/macro/all_pages.rb +1 -1
- data/lib/gollum-lib/macro/audio.rb +1 -1
- data/lib/gollum-lib/macro/global_toc.rb +1 -1
- data/lib/gollum-lib/macro/navigation.rb +1 -1
- data/lib/gollum-lib/macro/series.rb +4 -4
- data/lib/gollum-lib/macro/video.rb +1 -1
- data/lib/gollum-lib/markups.rb +1 -1
- data/lib/gollum-lib/version.rb +1 -1
- data/lib/gollum-lib/wiki.rb +8 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90304790b813ff264f9bbdcb865913290b3e53d3c234a9bb66deaa48a9a79e06
|
4
|
+
data.tar.gz: b911ed6044d4488a87afbcd50f83e68e980c0941a8e8410141ecdbf835b87053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c54a7337aad59a03103e6c95c7b5822eac8912c69e552298d1773b8e5f64dc4a26c1445b108f80fd50bb163918349ca394c3cdc9c8b3a48a60e58c3d737d021
|
7
|
+
data.tar.gz: 2731cd5fef0f1f3f3e7b937db617c3cbe390b6c79d645dee2a374ba51e3d1059446520c1b5486f558d6662d31878dc19866a6126c38313642854ace36a727b38
|
data/Guardfile
ADDED
data/HISTORY.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# v5.1.2
|
2
|
+
|
3
|
+
* SECURITY UPDATE: sanitize HTML generated by Macros.
|
4
|
+
|
1
5
|
# v5.0.1
|
2
6
|
|
3
|
-
Bugfix release: fix emoji when using base path. Thanks to @heavywatal.
|
7
|
+
* Bugfix release: fix emoji when using base path. Thanks to @heavywatal.
|
4
8
|
|
5
9
|
# v5.0
|
6
10
|
|
@@ -23,11 +27,11 @@ For a detailed overview of changes in 5.0 and a guide to migrating your wiki, se
|
|
23
27
|
** New Macro for listing contents of (sub)directories: `Navigation()`
|
24
28
|
** Table of Contents now supports setting max heading level
|
25
29
|
|
26
|
-
# v4.0.2 /2015-
|
30
|
+
# v4.0.2 / 2015-01-19
|
27
31
|
|
28
32
|
* Bugfixes
|
29
33
|
|
30
|
-
# v4.0.1 /2014-12-04
|
34
|
+
# v4.0.1 / 2014-12-04
|
31
35
|
|
32
36
|
* Security fix for [remote code execution issue](https://github.com/gollum/gollum/issues/913). Please update!
|
33
37
|
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@ gollum lib -- A wiki built on top of Git
|
|
2
2
|
========================================
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/gollum-lib.svg)](http://badge.fury.io/rb/gollum-lib)
|
5
|
-
[![Build
|
5
|
+
[![Ruby Build](https://github.com/gollum/gollum-lib/actions/workflows/test.yaml/badge.svg)](https://github.com/gollum/gollum-lib/actions/workflows/test.yaml)
|
6
6
|
[![Cutting Edge Dependency Status](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum-lib/svg 'Cutting Edge Dependency Status')](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum-lib/info)
|
7
7
|
|
8
8
|
## DESCRIPTION
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
3
|
require 'date'
|
4
|
+
require 'tempfile'
|
4
5
|
|
5
6
|
#############################################################################
|
6
7
|
#
|
@@ -12,11 +13,23 @@ def name
|
|
12
13
|
"gollum-lib"
|
13
14
|
end
|
14
15
|
|
16
|
+
def date
|
17
|
+
Time.now.strftime("%Y-%m-%d")
|
18
|
+
end
|
19
|
+
|
15
20
|
def version
|
16
21
|
line = File.read("lib/gollum-lib/version.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
22
|
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
23
|
end
|
19
24
|
|
25
|
+
def latest_changes_file
|
26
|
+
'LATEST_CHANGES.md'
|
27
|
+
end
|
28
|
+
|
29
|
+
def history_file
|
30
|
+
'HISTORY.md'
|
31
|
+
end
|
32
|
+
|
20
33
|
# assumes x.y.z all digit version
|
21
34
|
def next_version
|
22
35
|
# x.y.z
|
@@ -38,24 +51,16 @@ def bump_version
|
|
38
51
|
new_version
|
39
52
|
end
|
40
53
|
|
41
|
-
def date
|
42
|
-
Date.today.to_s
|
43
|
-
end
|
44
|
-
|
45
|
-
def rubyforge_project
|
46
|
-
name
|
47
|
-
end
|
48
|
-
|
49
54
|
def gemspec_file
|
50
55
|
"gemspec.rb"
|
51
56
|
end
|
52
57
|
|
53
58
|
def gemspecs
|
54
|
-
|
59
|
+
["#{name}.gemspec", "#{name}_java.gemspec"]
|
55
60
|
end
|
56
61
|
|
57
62
|
def gem_files
|
58
|
-
|
63
|
+
["#{name}-#{version}.gem", "#{name}-#{version}-java.gem"]
|
59
64
|
end
|
60
65
|
|
61
66
|
def replace_header(head, header_name)
|
@@ -106,23 +111,19 @@ task :bump do
|
|
106
111
|
Rake::Task[:validate].execute
|
107
112
|
end
|
108
113
|
|
109
|
-
desc "Build and install"
|
110
|
-
task :install => :build do
|
111
|
-
sh "gem install --local --no-document pkg/#{name}-#{version}.gem"
|
112
|
-
end
|
113
|
-
|
114
114
|
#############################################################################
|
115
115
|
#
|
116
116
|
# Packaging tasks
|
117
117
|
#
|
118
118
|
#############################################################################
|
119
119
|
|
120
|
-
desc 'Create a release build'
|
120
|
+
desc 'Create a release build and push to rubygems'
|
121
121
|
task :release => :build do
|
122
122
|
unless `git branch` =~ /master/
|
123
123
|
puts "You must be on the master branch to release!"
|
124
124
|
exit!
|
125
125
|
end
|
126
|
+
Rake::Task[:changelog].execute
|
126
127
|
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
127
128
|
sh "git pull --rebase origin master"
|
128
129
|
sh "git tag v#{version}"
|
@@ -150,25 +151,23 @@ desc 'Update gemspec'
|
|
150
151
|
task :gemspec => :validate do
|
151
152
|
# read spec file and split out manifest section
|
152
153
|
spec = File.read(gemspec_file)
|
153
|
-
head,
|
154
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
154
155
|
|
155
|
-
# replace name
|
156
|
+
# replace name and version
|
156
157
|
replace_header(head, :name)
|
157
|
-
replace_header(head, :
|
158
|
-
#comment this out if your rubyforge_project has a different name
|
159
|
-
replace_header(head, :rubyforge_project)
|
158
|
+
replace_header(head, :version)
|
160
159
|
|
161
160
|
# determine file list from git ls-files
|
162
161
|
files = `git ls-files`.
|
163
162
|
split("\n").
|
164
163
|
sort.
|
165
164
|
reject { |file| file =~ /^\./ }.
|
166
|
-
reject { |file| file =~ /^(rdoc|pkg|test|Home\.md|\.gitattributes
|
165
|
+
reject { |file| file =~ /^(rdoc|pkg|test|Home\.md|\.gitattributes)/ }.
|
167
166
|
map { |file| " #{file}" }.
|
168
167
|
join("\n")
|
169
168
|
|
170
169
|
# piece file back together and write
|
171
|
-
manifest = " s.files = %w
|
170
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
172
171
|
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
173
172
|
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
174
173
|
puts "Updated #{gemspec_file}"
|
@@ -186,3 +185,61 @@ task :validate do
|
|
186
185
|
exit!
|
187
186
|
end
|
188
187
|
end
|
188
|
+
|
189
|
+
desc 'Build changlog'
|
190
|
+
task :changelog do
|
191
|
+
[latest_changes_file, history_file].each do |f|
|
192
|
+
unless File.exists?(f)
|
193
|
+
puts "#{f} does not exist but is required to build a new release."
|
194
|
+
exit!
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
latest_changes = File.open(latest_changes_file)
|
199
|
+
version_pattern = "# #{version}"
|
200
|
+
|
201
|
+
if !`grep "#{version_pattern}" #{history_file}`.empty?
|
202
|
+
puts "#{version} is already described in #{history_file}"
|
203
|
+
exit!
|
204
|
+
end
|
205
|
+
|
206
|
+
begin
|
207
|
+
unless latest_changes.readline.chomp! =~ %r{#{version_pattern}}
|
208
|
+
puts "#{latest_changes_file} should begin with '#{version_pattern}'"
|
209
|
+
exit!
|
210
|
+
end
|
211
|
+
rescue EOFError
|
212
|
+
puts "#{latest_changes_file} is empty!"
|
213
|
+
exit!
|
214
|
+
end
|
215
|
+
|
216
|
+
body = latest_changes.read
|
217
|
+
body.scan(/\s*#\s+\d\.\d.*/) do |match|
|
218
|
+
puts "#{latest_changes_file} may not contain multiple markdown headers!"
|
219
|
+
exit!
|
220
|
+
end
|
221
|
+
|
222
|
+
temp = Tempfile.new
|
223
|
+
temp.puts("#{version_pattern} / #{date}\n#{body}\n\n")
|
224
|
+
temp.close
|
225
|
+
`cat #{history_file} >> #{temp.path}`
|
226
|
+
`cat #{temp.path} > #{history_file}`
|
227
|
+
end
|
228
|
+
|
229
|
+
desc 'Precompile assets'
|
230
|
+
task :precompile do
|
231
|
+
require './lib/gollum/app.rb'
|
232
|
+
Precious::App.set(:environment, :production)
|
233
|
+
env = Precious::Assets.sprockets
|
234
|
+
path = ENV.fetch('GOLLUM_ASSETS_PATH', ::File.join(File.dirname(__FILE__), 'lib/gollum/public/assets'))
|
235
|
+
manifest = Sprockets::Manifest.new(env, path)
|
236
|
+
Sprockets::Helpers.configure do |config|
|
237
|
+
config.environment = env
|
238
|
+
config.prefix = Precious::Assets::ASSET_URL
|
239
|
+
config.digest = true
|
240
|
+
config.public_path = path
|
241
|
+
config.manifest = manifest
|
242
|
+
end
|
243
|
+
puts "Precompiling assets to #{path}..."
|
244
|
+
manifest.compile(Precious::Assets::MANIFEST)
|
245
|
+
end
|
data/gemspec.rb
CHANGED
@@ -1,16 +1,11 @@
|
|
1
1
|
def specification(version, default_adapter, platform = nil)
|
2
2
|
Proc.new do |s|
|
3
|
-
s.specification_version = 2 if s.respond_to? :specification_version=
|
4
3
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
5
|
-
s.rubygems_version = '0.0.1'
|
6
4
|
s.required_ruby_version = '>= 2.4'
|
7
5
|
|
8
6
|
s.name = 'gollum-lib'
|
9
7
|
s.version = version
|
10
8
|
s.platform = platform if platform
|
11
|
-
s.date = '2021-06-28'
|
12
|
-
s.date = '2017-04-13'
|
13
|
-
s.rubyforge_project = 'gollum-lib'
|
14
9
|
s.license = 'MIT'
|
15
10
|
|
16
11
|
s.summary = 'A simple, Git-powered wiki.'
|
@@ -35,14 +30,14 @@ def specification(version, default_adapter, platform = nil)
|
|
35
30
|
s.add_dependency 'twitter-text', '1.14.7'
|
36
31
|
|
37
32
|
s.add_development_dependency 'org-ruby', '~> 0.9.9'
|
38
|
-
s.add_development_dependency 'kramdown', '~> 2.3
|
33
|
+
s.add_development_dependency 'kramdown', '~> 2.3'
|
39
34
|
s.add_development_dependency 'kramdown-parser-gfm', '~> 1.1.0'
|
40
35
|
s.add_development_dependency 'RedCloth', '~> 4.2.9'
|
41
36
|
s.add_development_dependency 'mocha', '~> 1.11'
|
42
37
|
s.add_development_dependency 'shoulda', '~> 4.0'
|
43
38
|
s.add_development_dependency 'wikicloth', '~> 0.8.3'
|
44
39
|
s.add_development_dependency 'bibtex-ruby', '~> 6.0'
|
45
|
-
s.add_development_dependency 'citeproc-ruby', '~>
|
40
|
+
s.add_development_dependency 'citeproc-ruby', '~> 2.0'
|
46
41
|
s.add_development_dependency 'unicode_utils', '~> 1.4.0' # required by citeproc-ruby on ruby < 2.4
|
47
42
|
s.add_development_dependency 'rake', '~> 13.0'
|
48
43
|
s.add_development_dependency 'pry', '~> 0.13'
|
@@ -57,8 +52,9 @@ def specification(version, default_adapter, platform = nil)
|
|
57
52
|
s.add_development_dependency 'twitter_cldr', '~> 6.4'
|
58
53
|
|
59
54
|
# = MANIFEST =
|
60
|
-
s.files = %w
|
55
|
+
s.files = %w[
|
61
56
|
Gemfile
|
57
|
+
Guardfile
|
62
58
|
HISTORY.md
|
63
59
|
LICENSE
|
64
60
|
README.md
|
@@ -109,7 +105,7 @@ def specification(version, default_adapter, platform = nil)
|
|
109
105
|
lib/gollum-lib/version.rb
|
110
106
|
lib/gollum-lib/wiki.rb
|
111
107
|
licenses/licenses.txt
|
112
|
-
|
108
|
+
]
|
113
109
|
# = MANIFEST =
|
114
110
|
|
115
111
|
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
@@ -2,8 +2,21 @@
|
|
2
2
|
|
3
3
|
# Code
|
4
4
|
#
|
5
|
-
#
|
5
|
+
# Handle code blocks:
|
6
|
+
# - in the extractstep, extract them so they don't get rendered by the Render filter
|
7
|
+
# - in the process step, apply highlighting and wrapping and reinsert them into the document
|
8
|
+
|
6
9
|
class Gollum::Filter::Code < Gollum::Filter
|
10
|
+
|
11
|
+
# The @language_handlers Hash can be filled with Regep keys and corresponding Proc values. The Procs will be executed to handle a codeblock whose language definition matches the key.
|
12
|
+
# See the Code Filter tests for an example
|
13
|
+
# Use the Gollum::Filter::Code.language_handlers method to access and modify this class instance variable
|
14
|
+
@language_handlers = {}
|
15
|
+
|
16
|
+
class << self
|
17
|
+
attr_accessor :language_handlers
|
18
|
+
end
|
19
|
+
|
7
20
|
def extract(data)
|
8
21
|
case @markup.format
|
9
22
|
when :asciidoc
|
@@ -63,8 +76,14 @@ class Gollum::Filter::Code < Gollum::Filter
|
|
63
76
|
blocks << [spec[:lang], code]
|
64
77
|
end
|
65
78
|
|
66
|
-
|
79
|
+
wrapped_blocks = []
|
67
80
|
blocks.each do |lang, code|
|
81
|
+
|
82
|
+
if (_pattern, proc = self.class.language_handlers.find { |pattern, _v| lang =~ pattern }) then
|
83
|
+
wrapped_blocks << proc.call(CGI.escape_html(lang), CGI.escape_html(code))
|
84
|
+
next
|
85
|
+
end
|
86
|
+
|
68
87
|
encoding = @markup.encoding || 'utf-8'
|
69
88
|
|
70
89
|
if defined? Pygments
|
@@ -95,12 +114,12 @@ class Gollum::Filter::Code < Gollum::Filter
|
|
95
114
|
end
|
96
115
|
end
|
97
116
|
|
98
|
-
|
117
|
+
wrapped_blocks << hl_code
|
99
118
|
end
|
100
119
|
|
101
120
|
@map.each do |id, spec|
|
102
121
|
body = spec[:output] || begin
|
103
|
-
if (body =
|
122
|
+
if (body = wrapped_blocks.shift.to_s).size > 0
|
104
123
|
@markup.update_cache(:code, id, body)
|
105
124
|
body
|
106
125
|
else
|
@@ -4,7 +4,7 @@ require 'octicons'
|
|
4
4
|
# Replace specified tokens with dynamically generated content.
|
5
5
|
class Gollum::Filter::Macro < Gollum::Filter
|
6
6
|
def extract(data)
|
7
|
-
quoted_arg = %r{".*?"}
|
7
|
+
quoted_arg = %r{".*?(?<!\\)"} # use a negative lookbehind to not terminate on a " preceeded by \
|
8
8
|
unquoted_arg = %r{[^,)]+}
|
9
9
|
named_arg = %r{[a-z0-9_]+=".*?"}
|
10
10
|
|
@@ -26,7 +26,7 @@ class Gollum::Filter::Macro < Gollum::Filter
|
|
26
26
|
if argument =~ /^([a-z0-9_]+)="(.*?)"/
|
27
27
|
opts[Regexp.last_match[1]] = Regexp.last_match[2]
|
28
28
|
elsif argument =~ /^"(.*)"$/
|
29
|
-
|
29
|
+
args << Regexp.last_match[1].gsub("\\\"", "\"")
|
30
30
|
else
|
31
31
|
args << argument
|
32
32
|
end
|
@@ -55,6 +55,6 @@ class Gollum::Filter::Macro < Gollum::Filter
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
data
|
58
|
+
sanitize(data)
|
59
59
|
end
|
60
60
|
end
|
@@ -69,7 +69,7 @@ class Gollum::Filter::PlantUML < Gollum::Filter
|
|
69
69
|
# Extract all sequence diagram blocks into the map and replace with
|
70
70
|
# placeholders.
|
71
71
|
def extract(data)
|
72
|
-
data.gsub(/(@
|
72
|
+
data.gsub(/(@start(uml|json|yaml|salt|mindmap|wbs|math|latex)\r?\n.+?\r?\n@end\2\r?$)/m) do
|
73
73
|
id = "#{open_pattern}#{Digest::SHA1.hexdigest($1)}#{close_pattern}"
|
74
74
|
@map[id] = { :code => $1 }
|
75
75
|
id
|
@@ -125,7 +125,7 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
125
125
|
# Creates an anchor element with the given name and adds it before
|
126
126
|
# the given header element.
|
127
127
|
def add_anchor_to_header(header, name)
|
128
|
-
a = Nokogiri::XML::Node.new('a', @doc)
|
128
|
+
a = Nokogiri::XML::Node.new('a', @doc.document)
|
129
129
|
a['class'] = 'anchor'
|
130
130
|
a['id'] = name
|
131
131
|
a['href'] = "##{name}"
|
@@ -143,9 +143,9 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
143
143
|
|
144
144
|
if @tail_level < level
|
145
145
|
while @tail_level < level
|
146
|
-
list = Nokogiri::XML::Node.new('ul', @doc)
|
146
|
+
list = Nokogiri::XML::Node.new('ul', @doc.document)
|
147
147
|
@tail.add_child(list)
|
148
|
-
@tail = list.add_child(Nokogiri::XML::Node.new('li', @doc))
|
148
|
+
@tail = list.add_child(Nokogiri::XML::Node.new('li', @doc.document))
|
149
149
|
@tail_level += 1
|
150
150
|
end
|
151
151
|
else
|
@@ -153,7 +153,7 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
153
153
|
@tail = @tail.parent.parent
|
154
154
|
@tail_level -= 1
|
155
155
|
end
|
156
|
-
@tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc))
|
156
|
+
@tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc.document))
|
157
157
|
end
|
158
158
|
|
159
159
|
# % -> %25 so anchors work on Firefox. See issue #475
|
@@ -3,7 +3,7 @@ module Gollum
|
|
3
3
|
class AllPages < Gollum::Macro
|
4
4
|
def render
|
5
5
|
if @wiki.pages.size > 0
|
6
|
-
'<ul id="pages">' + @wiki.pages.map { |p| "<li>#{p.name}</li>" }.join + '</ul>'
|
6
|
+
'<ul id="pages">' + @wiki.pages.map { |p| "<li>#{CGI::escapeHTML(p.name)}</li>" }.join + '</ul>'
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -2,7 +2,7 @@ module Gollum
|
|
2
2
|
class Macro
|
3
3
|
class Audio < Gollum::Macro
|
4
4
|
def render (fname)
|
5
|
-
"<audio width=\"100%\" height=\"100%\" src=\"#{fname}\" controls=\"\"> HTML5 audio is not supported on this Browser.</audio>"
|
5
|
+
"<audio width=\"100%\" height=\"100%\" src=\"#{CGI::escapeHTML(fname)}\" controls=\"\"> HTML5 audio is not supported on this Browser.</audio>"
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
@@ -4,7 +4,7 @@ module Gollum
|
|
4
4
|
def render(title = "Global Table of Contents")
|
5
5
|
if @wiki.pages.size > 0
|
6
6
|
prepath = @wiki.base_path.sub(/\/$/, '')
|
7
|
-
result = '<ul>' + @wiki.pages.map { |p| "<li><a href=\"#{prepath
|
7
|
+
result = '<ul>' + @wiki.pages.map { |p| "<li><a href=\"#{CGI::escapeHTML(prepath + "/" + p.escaped_url_path)}\">#{CGI::escapeHTML(p.url_path)}</a></li>" }.join + '</ul>'
|
8
8
|
end
|
9
9
|
"<div class=\"toc\"><div class=\"toc-title\">#{title}</div>#{result}</div>"
|
10
10
|
end
|
@@ -9,7 +9,7 @@ module Gollum
|
|
9
9
|
list_items = pages.map do |page|
|
10
10
|
if toc_root_path == '.' || page.url_path =~ /^#{toc_root_path}\//
|
11
11
|
path_display = (full_path || toc_root_path == '.') ? page.url_path : page.url_path.sub(/^#{toc_root_path}\//,"").sub(/^\//,'')
|
12
|
-
"<li><a href=\"#{prepath
|
12
|
+
"<li><a href=\"#{CGI::escapeHTML(prepath + "/" + page.escaped_url_path)}\">#{CGI::escapeHTML(path_display)}</a></li>"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
result = "<ul>#{list_items.join}</ul>"
|
@@ -8,8 +8,8 @@ module Gollum
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def render_links(previous_page, next_page)
|
11
|
-
result = "Previous: <a href=\"#{::File.join(@wiki.base_path,previous_page.escaped_url_path)}\">#{previous_page.name}</a>" if previous_page
|
12
|
-
result = "#{result}#{result ? ' | ' : ''}Next: <a href=\"#{::File.join(@wiki.base_path,next_page.escaped_url_path)}\">#{next_page.name}</a>" if next_page
|
11
|
+
result = "Previous: <a href=\"#{CGI::escapeHTML(::File.join(@wiki.base_path,previous_page.escaped_url_path))}\">#{CGI::escapeHTML(previous_page.name)}</a>" if previous_page
|
12
|
+
result = "#{result}#{result ? ' | ' : ''}Next: <a href=\"#{CGI::escapeHTML(::File.join(@wiki.base_path,next_page.escaped_url_path))}\">#{CGI::escapeHTML(next_page.name)}</a>" if next_page
|
13
13
|
wrap_result(result)
|
14
14
|
end
|
15
15
|
|
@@ -32,14 +32,14 @@ module Gollum
|
|
32
32
|
|
33
33
|
class SeriesStart < Gollum::Macro::Series
|
34
34
|
def render_links(previous_page, next_page)
|
35
|
-
result = "Next: <a href=\"#{::File.join(@wiki.base_path,next_page.escaped_url_path)}\">#{next_page.name}</a>" if next_page
|
35
|
+
result = "Next: <a href=\"#{CGI::escapeHTML(::File.join(@wiki.base_path,next_page.escaped_url_path))}\">#{CGI::escapeHTML(next_page.name)}</a>" if next_page
|
36
36
|
wrap_result(result)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
class SeriesEnd < Gollum::Macro::Series
|
41
41
|
def render_links(previous_page, next_page)
|
42
|
-
result = "Previous: <a href=\"#{::File.join(@wiki.base_path,previous_page.escaped_url_path)}\">#{previous_page.name}</a>" if previous_page
|
42
|
+
result = "Previous: <a href=\"#{CGI::escapeHTML(::File.join(@wiki.base_path,previous_page.escaped_url_path))}\">#{CGI::escapeHTML(previous_page.name)}</a>" if previous_page
|
43
43
|
wrap_result(result)
|
44
44
|
end
|
45
45
|
end
|
@@ -2,7 +2,7 @@ module Gollum
|
|
2
2
|
class Macro
|
3
3
|
class Video < Gollum::Macro
|
4
4
|
def render (fname)
|
5
|
-
"<video width=\"100%\" height=\"100%\" src=\"#{fname}\" controls=\"\"> HTML5 video is not supported on this Browser.</video>"
|
5
|
+
"<video width=\"100%\" height=\"100%\" src=\"#{CGI::escapeHTML(fname)}\" controls=\"\"> HTML5 video is not supported on this Browser.</video>"
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
data/lib/gollum-lib/markups.rb
CHANGED
@@ -81,7 +81,7 @@ module Gollum
|
|
81
81
|
:enabled => MarkupRegisterUtils::gem_exists?("creole"),
|
82
82
|
:reverse_links => true)
|
83
83
|
register(:rst, "reStructuredText",
|
84
|
-
:enabled => MarkupRegisterUtils::executable_exists?("
|
84
|
+
:enabled => MarkupRegisterUtils::executable_exists?("python3"),
|
85
85
|
:extensions => ['rest', 'rst'])
|
86
86
|
register(:asciidoc, "AsciiDoc",
|
87
87
|
:skip_filters => [:Tags],
|
data/lib/gollum-lib/version.rb
CHANGED
data/lib/gollum-lib/wiki.rb
CHANGED
@@ -57,6 +57,10 @@ module Gollum
|
|
57
57
|
# Defaults to false
|
58
58
|
attr_reader :css
|
59
59
|
|
60
|
+
# Whether or not content is editable.
|
61
|
+
# Defaults to true
|
62
|
+
attr_reader :allow_editing
|
63
|
+
|
60
64
|
# Sets page title to value of first h1
|
61
65
|
# Defaults to false
|
62
66
|
attr_reader :h1_title
|
@@ -106,6 +110,7 @@ module Gollum
|
|
106
110
|
# :bar_side - Where the sidebar should be displayed, may be:
|
107
111
|
# - :left
|
108
112
|
# - :right
|
113
|
+
# :allow_editing - Set whether wiki content can be edited. Default: true
|
109
114
|
# :allow_uploads - Set to true to allow file uploads.
|
110
115
|
# :per_page_uploads - Whether uploads should be stored in a central
|
111
116
|
# 'uploads' directory, or in a directory named for
|
@@ -142,6 +147,7 @@ module Gollum
|
|
142
147
|
@bar_side = options.fetch :sidebar, :right
|
143
148
|
@user_icons = ['gravatar', 'identicon'].include?(options[:user_icons]) ?
|
144
149
|
options[:user_icons] : 'none'
|
150
|
+
@allow_editing = options.fetch :allow_editing, true
|
145
151
|
@allow_uploads = options.fetch :allow_uploads, false
|
146
152
|
@per_page_uploads = options.fetch :per_page_uploads, false
|
147
153
|
@metadata = options.fetch :metadata, {}
|
@@ -594,10 +600,10 @@ module Gollum
|
|
594
600
|
|
595
601
|
# Enable 4.x compatibility behavior for links
|
596
602
|
attr_reader :global_tag_lookup
|
597
|
-
|
603
|
+
|
598
604
|
# Enable 4.x compatibility for case-case_insensitive links
|
599
605
|
attr_reader :case_insensitive_tag_lookup
|
600
|
-
|
606
|
+
|
601
607
|
# Spaces in tag paths are treated as dashes (-)
|
602
608
|
attr_reader :hyphened_tag_lookup
|
603
609
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gollum-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: '5.2'
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gollum-rjgit_adapter
|
@@ -143,14 +143,14 @@ dependencies:
|
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 2.3
|
146
|
+
version: '2.3'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 2.3
|
153
|
+
version: '2.3'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: kramdown-parser-gfm
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,14 +241,14 @@ dependencies:
|
|
241
241
|
requirements:
|
242
242
|
- - "~>"
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
version: '
|
244
|
+
version: '2.0'
|
245
245
|
type: :development
|
246
246
|
prerelease: false
|
247
247
|
version_requirements: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
249
|
- - "~>"
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
version: '
|
251
|
+
version: '2.0'
|
252
252
|
- !ruby/object:Gem::Dependency
|
253
253
|
name: unicode_utils
|
254
254
|
requirement: !ruby/object:Gem::Requirement
|
@@ -398,6 +398,7 @@ extra_rdoc_files:
|
|
398
398
|
- LICENSE
|
399
399
|
files:
|
400
400
|
- Gemfile
|
401
|
+
- Guardfile
|
401
402
|
- HISTORY.md
|
402
403
|
- LICENSE
|
403
404
|
- README.md
|
@@ -470,6 +471,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
470
471
|
requirements: []
|
471
472
|
rubygems_version: 3.0.3
|
472
473
|
signing_key:
|
473
|
-
specification_version:
|
474
|
+
specification_version: 4
|
474
475
|
summary: A simple, Git-powered wiki.
|
475
476
|
test_files: []
|