Bump Version Number
Version 0.16 Also, allow Includes of single-letter pages.
This commit is contained in:
parent
0f843bc537
commit
61c3fb1ab9
3 changed files with 6 additions and 8 deletions
|
@ -232,7 +232,7 @@ end
|
||||||
module Instiki
|
module Instiki
|
||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 15
|
MINOR = 16
|
||||||
TINY = 0
|
TINY = 0
|
||||||
SUFFIX = '(MML+)'
|
SUFFIX = '(MML+)'
|
||||||
PRERELEASE = 'pre' # false
|
PRERELEASE = 'pre' # false
|
||||||
|
|
|
@ -9,7 +9,7 @@ require 'chunks/wiki'
|
||||||
|
|
||||||
class Include < WikiChunk::WikiReference
|
class Include < WikiChunk::WikiReference
|
||||||
|
|
||||||
INCLUDE_PATTERN = /\[\[!include\s+([^\]\s][^\]]+?)\s*\]\]/i
|
INCLUDE_PATTERN = /\[\[!include\s+([^\]\s][^\]]*?)\s*\]\]/i
|
||||||
def self.pattern() INCLUDE_PATTERN end
|
def self.pattern() INCLUDE_PATTERN end
|
||||||
|
|
||||||
def initialize(match_data, content)
|
def initialize(match_data, content)
|
||||||
|
@ -53,11 +53,9 @@ class Include < WikiChunk::WikiReference
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_to_include_list
|
def add_to_include_list
|
||||||
if Thread.current[:included_by]
|
Thread.current[:included_by] ?
|
||||||
Thread.current[:included_by].push(@content.page_name)
|
Thread.current[:included_by].push(@content.page_name) :
|
||||||
else
|
|
||||||
Thread.current[:included_by] = [@content.page_name]
|
Thread.current[:included_by] = [@content.page_name]
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self_inclusion(refpage)
|
def self_inclusion(refpage)
|
||||||
|
|
|
@ -70,9 +70,9 @@ class WikiTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_include_chunk_pattern
|
def test_include_chunk_pattern
|
||||||
content = 'This is a [[!include pagename]] and [[!include WikiWord]] but [[blah]]'
|
content = 'This is a [[!include pagename]] and [[!include WikiWord]] and [[!include x]]but [[blah]]'
|
||||||
recognized_includes = content.scan(Include.pattern).collect { |m| m[0] }
|
recognized_includes = content.scan(Include.pattern).collect { |m| m[0] }
|
||||||
assert_equal %w(pagename WikiWord), recognized_includes
|
assert_equal %w(pagename WikiWord x), recognized_includes
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_textile_link
|
def test_textile_link
|
||||||
|
|
Loading…
Add table
Reference in a new issue