nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9c29b6
)
nitiwiki: add a simple command extraction on wikilinks.
author
Jean Privat
<jean@pryen.org>
Wed, 11 Nov 2015 16:15:01 +0000
(11:15 -0500)
committer
Jean Privat
<jean@pryen.org>
Wed, 11 Nov 2015 20:29:50 +0000
(15:29 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>
contrib/nitiwiki/src/wiki_links.nit
patch
|
blob
|
history
diff --git
a/contrib/nitiwiki/src/wiki_links.nit
b/contrib/nitiwiki/src/wiki_links.nit
index
a49edfb
..
40f747c
100644
(file)
--- a/
contrib/nitiwiki/src/wiki_links.nit
+++ b/
contrib/nitiwiki/src/wiki_links.nit
@@
-244,6
+244,14
@@
class NitiwikiDecorator
var name = token.name
v.add "<a "
if not link.has_prefix("http://") and not link.has_prefix("https://") then
+ # Extract commands from the link.
+ var command = null
+ var command_split = link.split_once_on(":")
+ if command_split.length > 1 then
+ command = command_split[0].trim
+ link = command_split[1].trim
+ end
+
if link.has("#") then
var parts = link.split_with("#")
link = parts.first