gollum-lib 5.0.4 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e49c63e5f17326f8cd276fef19bfc1b789a6ea1eb84ab34254c437041f082965
4
- data.tar.gz: 32c68ea6732fa95cce77de649ffe63af6a36783445c92151aabd7aaec8cd4ceb
3
+ metadata.gz: 4a2bc81f80db1d1d27d7bbf98ee2c7de3b78da25a4e068b506914889a59b78a9
4
+ data.tar.gz: 59b0439f772973507254aaa566e134984c5c1761f7242b4c09c9ef3fe9e34aab
5
5
  SHA512:
6
- metadata.gz: 84a069e897db4f494c01d7acf82c5818c29de323f7ba70c1824a9554be1521e94038836c889f27e3b04ea014c04c6916970f7a1a454c3793adfa14442b394bd9
7
- data.tar.gz: 13818f84f30dd46bb983602e163e5a2ea1eeaa21bff10b4a835bfbbb014c200ccca4c84cbb24354d77ab015b50979d339c5ad4bc1496b9b57bedc2577325e71d
6
+ metadata.gz: 88d75e9d5f4cfa16dda0a8cd67dd6988a0894d19ad97a1d354cd3a7d96cf5bec6a0e350b48db91c796a2d2d5f43db79e6d021ae89f6af4442c1c5c36217dd8c5
7
+ data.tar.gz: 9ab4e40babd84d9baa3041e7212431fb05a95855dd428964e4d5467ebebd75b2405a1a7fbbb038a5ab8ca0ae14401f172eaf2f6f0e6fd8f510358e7b0f5cbb3c
data/Rakefile CHANGED
@@ -75,6 +75,7 @@ Rake::TestTask.new(:test) do |test|
75
75
  test.libs << 'lib' << 'test' << '.'
76
76
  test.pattern = 'test/**/test_*.rb'
77
77
  test.verbose = true
78
+ test.warning = false
78
79
  end
79
80
 
80
81
  desc "Generate RCov test coverage and open in your browser"
data/gemspec.rb CHANGED
@@ -8,7 +8,7 @@ def specification(version, default_adapter, platform = nil)
8
8
  s.name = 'gollum-lib'
9
9
  s.version = version
10
10
  s.platform = platform if platform
11
- s.date = '2020-04-29'
11
+ s.date = '2020-08-03'
12
12
  s.date = '2017-04-13'
13
13
  s.rubyforge_project = 'gollum-lib'
14
14
  s.license = 'MIT'
@@ -230,6 +230,7 @@ class Gollum::Filter::Tags < Gollum::Filter
230
230
  else
231
231
  name = page ? path_to_link_text(link) : link
232
232
  end
233
+
233
234
  link = page ? page.escaped_url_path : ERB::Util.url_encode(link).force_encoding('utf-8')
234
235
  generate_link(link, name, extra, presence)
235
236
  end
@@ -16,7 +16,7 @@ module Gollum
16
16
  # '/opt/local/bin/ruby.ext' -> 'ruby'
17
17
  def path_to_link_text(str)
18
18
  return nil unless str
19
- ::File.basename(str, ::File.extname(str))
19
+ ::File.basename(str, Page.valid_extension?(str) ? ::File.extname(str) : '')
20
20
  end
21
21
 
22
22
  end
@@ -25,6 +25,10 @@ module Gollum
25
25
  "<p class=\"gollum-error\">#{s}</p>"
26
26
  end
27
27
 
28
+ def active_page
29
+ return @page.parent_page || @page
30
+ end
31
+
28
32
  # The special class we reserve for only the finest of screwups. The
29
33
  # underscore is to make sure nobody can define a real, callable macro
30
34
  # with the same name, because that would be... exciting.
@@ -3,7 +3,7 @@ module Gollum
3
3
 
4
4
  class Series < Gollum::Macro
5
5
  def render(series_prefix = "")
6
- raise "This page's name does not match the prefix '#{series_prefix}'" unless @page.name =~ /^#{series_prefix}/
6
+ raise "This page's name does not match the prefix '#{series_prefix}'" unless active_page.name =~ /^#{series_prefix}/
7
7
  render_links(*find_series(series_prefix))
8
8
  end
9
9
 
@@ -21,7 +21,7 @@ module Gollum
21
21
  dir = @wiki.pages.select {|page| ::File.dirname(page.path) == ::File.dirname(@page.path)}
22
22
  dir.select! {|page| page.name =~ /\A#{series_prefix}/ } unless series_prefix.empty?
23
23
  dir.sort_by! {|page| page.name}
24
- self_index = dir.find_index {|page| page.name == @page.name}
24
+ self_index = dir.find_index {|page| page.name == active_page.name}
25
25
  if self_index > 0
26
26
  return dir[self_index-1], dir[self_index+1]
27
27
  else
@@ -58,7 +58,7 @@ module Gollum
58
58
  if gem_exists?('pandoc-ruby')
59
59
  GitHub::Markup::Markdown::MARKDOWN_GEMS.delete('kramdown')
60
60
  GitHub::Markup::Markdown::MARKDOWN_GEMS['pandoc-ruby'] = proc { |content|
61
- PandocRuby.convert(content, :from => :markdown, :to => :html, :filter => 'pandoc-citeproc')
61
+ PandocRuby.convert(content, :from => 'markdown-tex_math_dollars-raw_tex', :to => :html, :filter => 'pandoc-citeproc')
62
62
  }
63
63
  else
64
64
  GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
@@ -85,7 +85,8 @@ module Gollum
85
85
  :extensions => ['rest', 'rst'])
86
86
  register(:asciidoc, "AsciiDoc",
87
87
  :skip_filters => [:Tags],
88
- :enabled => MarkupRegisterUtils::gem_exists?("asciidoctor"))
88
+ :enabled => MarkupRegisterUtils::gem_exists?("asciidoctor"),
89
+ :extensions => ['adoc','asciidoc'])
89
90
  register(:mediawiki, "MediaWiki",
90
91
  :enabled => MarkupRegisterUtils::gem_exists?("wikicloth"),
91
92
  :extensions => ['mediawiki','wiki'], :reverse_links => true)
@@ -277,7 +277,7 @@ module Gollum
277
277
  #
278
278
  # Returns the String extension (no leading period).
279
279
  def self.format_to_ext(format)
280
- format == :markdown ? "md" : format.to_s
280
+ Gollum::Markup.formats[format] ? Gollum::Markup.formats[format][:extensions].first : nil
281
281
  end
282
282
 
283
283
  # The underlying wiki repo.
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module Lib
3
- VERSION = '5.0.4'
3
+ VERSION = '5.0.5'
4
4
  end
5
5
  end
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.0.4
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner