* Tables containing links with a link text were misparsed, because the "|"

in the wikilink looked like a table field separator. Avoid this ambiguity
  by linkifying the data before parsing it as a table.
* Turn on allow_loose_quotes in the table plugin's Text::CSV object,
  so that links from wikilinks don't confuse the parser.
master
joey 2007-08-28 23:06:24 +00:00
parent 25294defb8
commit 4142c02f73
4 changed files with 31 additions and 13 deletions

View File

@ -22,6 +22,10 @@ sub preprocess (@) { #{{{
}
$params{data} = readfile(srcfile($params{file}));
}
else {
$params{data} = IkiWiki::linkify($params{page},
$params{destpage}, $params{data});
}
if (lc $params{format} eq 'auto') {
# first try the more simple format
@ -92,6 +96,7 @@ sub split_csv ($$) { #{{{
my $csv = Text::CSV->new({
sep_char => defined $delimiter ? $delimiter : ",",
binary => 1,
allow_loose_quotes => 1,
}) || error("could not create a Text::CSV object");
my $l=0;

7
debian/changelog vendored
View File

@ -10,8 +10,13 @@ ikiwiki (2.7) UNRELEASED; urgency=low
wrapper.
* Fix some taint issues with generating wrappers using the command line.
* Don't allow newlines in link text in a wikilink.
* Tables containing links with a link text were misparsed, because the "|"
in the wikilink looked like a table field separator. Avoid this ambiguity
by linkifying the data before parsing it as a table.
* Turn on allow_loose_quotes in the table plugin's Text::CSV object,
so that links from wikilinks don't confuse the parser.
-- Joey Hess <joeyh@debian.org> Tue, 28 Aug 2007 18:54:06 -0400
-- Joey Hess <joeyh@debian.org> Tue, 28 Aug 2007 19:03:34 -0400
ikiwiki (2.6.1) unstable; urgency=low

View File

@ -1,24 +1,32 @@
I try to create wikilink in table. But it does not work. Here is example:
||table class=table1 data="""
||wikilink_test|servers/webmail1]]
||wikilink_test\|servers/webmail1]]
[wikilink test](/servers/webmail1)
"""]]
[[table class=table1 data="""
[[wikilink_test|index]]
[[wikilink_test\|index]]
[wikilink test](/servers/webmail1)
"""]]
First two wikilink entries do not work.
The last one is url link and it works but it is not a wikilink. Or maybe it does not matter if I use URL links in stead of wikilinks for local wiki content?
> [[fixed|done]] --[[Joey]]
What exactly is a difference between wikilink and URL reference to the same page ?
> ikiwiki will not be able to track pages linked using urls as having a
> link.
Trying to report this I found something weird. I changed in the example [[ with || because wiki renders something wrongly. You can see what I tried originally here:
[[table class=table1 data="""
[[wikilink_test|servers/webmail1]]
[[wikilink_test\|servers/webmail1]]
[wikilink test](/servers/webmail1)
"""]]
\[[table class=table1 data="""
[[wikilink_test|servers/webmail1]]
[[wikilink_test|servers/webmail1]]
[wikilink test](/servers/webmail1)
"""]]
Please click edit to see unrendered text. First, it is not monospace-d (I have 4 spaces) and second, some wierd html is shown...
Am I doing something wrong ?
> See above for the right way to do it. Note that I also fixed a minor bug
> in ikiwiki that makes it not display the opening `[[` above. --[[Joey]]

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-08-27 21:24-0400\n"
"POT-Creation-Date: 2007-08-28 18:22-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -589,7 +589,7 @@ msgstr ""
msgid "usage: ikiwiki [options] source dest"
msgstr ""
#: ../ikiwiki.in:81
#: ../ikiwiki.in:83
msgid "usage: --set var=value"
msgstr ""