Fix for multiple includes on the same page; ignoring leading/trailing whitespace in WikiLinks [both by dm1]

This commit is contained in:
Alexey Verkhovsky 2005-05-12 00:56:57 +00:00
parent 7c5958ae7b
commit f6a3b88693
4 changed files with 36 additions and 3 deletions

View file

@ -9,7 +9,7 @@ require 'chunks/wiki'
class Include < WikiChunk::WikiReference
INCLUDE_PATTERN = /\[\[!include(.*)\]\]\s*/i
INCLUDE_PATTERN = /\[\[!include\s+(.*?)\]\]\s*/i
def self.pattern() INCLUDE_PATTERN end

View file

@ -99,7 +99,7 @@ module WikiChunk
class Link < WikiLink
unless defined? WIKI_LINK
WIKI_LINK = /(":)?\[\[([^\]]+)\]\]/
WIKI_LINK = /(":)?\[\[\s*([^\]\s][^\]]+?)\s*\]\]/
LINK_TYPE_SEPARATION = Regexp.new('^(.+):((file)|(pic))$', 0, 'utf-8')
ALIAS_SEPARATION = Regexp.new('^(.+)\|(.+)$', 0, 'utf-8')
end