public
Fork of jnewland/git-wiki
Description: A wiki engine that uses a Git repository as its data store.
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/bmizerany/git-wiki.git
<nowiki/> support
jnewland (author)
Fri May 16 08:09:15 -0700 2008
commit  8cdece415247824a970be3d368891b7724293bab
tree    8991d38227b3cd969f76abe8dcb006f3c7524451
parent  b1ef6a089ae969528599728df4cf6685b79f1a62
...
8
9
10
11
12
 
 
13
14
 
15
 
16
17
18
...
8
9
10
 
 
11
12
13
 
14
15
16
17
18
19
0
@@ -8,11 +8,12 @@ end
0
 
0
 class String
0
   def wiki_linked
0
- self.gsub!(/\b((?:[A-Z]\w+){2,})/) { |m| "<a href=\"/#{m}\">#{m}</a>" }
0
- self.gsub!(/\[(\w+){2,}\]/) { |m|
0
+ self.gsub!(/(?!<nowiki>)(?>\b((?:[A-Z]\w+){2,}))(?!<\/nowiki>)/) { |m| "<a href=\"/#{m}\">#{m}</a>" }
0
+ self.gsub!(/\[(\w+){2,}\]/) { |m|
0
       m.gsub!(/(\[|\])/, '')
0
- "<a href=\"/#{m}\">#{m}</a>"
0
+ "<a href=\"/#{m}\">#{m}</a>"
0
     }
0
+ self.gsub!(/<\/?nowiki>/,'')
0
     self
0
   end
0
 end
...
13
14
15
16
 
17
18
19
...
13
14
15
 
16
17
18
19
0
@@ -13,7 +13,7 @@ class Page
0
   end
0
 
0
   def body
0
- @body ||= RubyPants.new(RedCloth.new(raw_body).to_html).to_html.wiki_linked
0
+ @body ||= RubyPants.new(RedCloth.new(raw_body.wiki_linked).to_html).to_html
0
   end
0
   
0
   def branch_name

Comments

    No one has commented yet.