Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 39 by PhilippeMGagne: Issues when rendering french wikitionary
http://code.google.com/p/gwtwiki/issues/detail?id=39
Here are some problems I had when rendering fr.wikitionary articles. I made
some patches in the
code,
1. there are templates with this construct: {{{{{1}}}}} (which means {{
{{{1}}} }}). The parser can't handle
this.
I fixed it by adding a test to be sure that after the 3rd '{' there is
something else than '{' (in
wikipediaParser.java)
2. There where trailing args because when reading the calling arguments,
the parser will puts in the
map the named arguments and put them a second time with a numeric key. For
some french template
it is not good (a named arg is given and the numeric one must be empty). I
fixed it by changing the
map assignation in TemplateParser.createSingleParameter:
} finally {
if (currOffset > lastOffset) {
if (trimNewlineRight) {
value =
Utils.trimNewlineRight(srcString.substring(lastOffset, currOffset));
} else {
value = srcString.substring(lastOffset,
currOffset).trim();
}
if (parameter != null) {
map.put(parameter, value);
} else {
map.put(Integer.toString(parameterCounter), value); //
PG
}
}
}
3. There is cases where a named arg is not given on the call. bliki will
then ask the
Model.getRawWikiContent() for something like "Modèle:lang/{{{1}}}" (which
is wrong) instead of asking
for "Modèle:lang/" (which is wright) .
My workaround is to wipe the "{...}" elements in Model.getRawWikiContent(),
but it would be a lot
better to filter it somewhere in the parser (when a parameter is not given,
wipe it).
I have yet to test extensively my workarounds.
What version of the product are you using? On what operating system?
Bliki 3.0.13
Please provide any additional information below.
I have attached a copy of my modified files. I added a "//PG" comment on
the modified lines.
Attachments:
TemplateParser.java 33.0 KB
WikipediaScanner.java 65.6 KB
--
You received this message because you are subscribed to the Google Groups "Bliki - Java/Eclipse Wikipedia API" group.
To post to this group, send email to
bl...@googlegroups.com
To unsubscribe from this group, send email to
bliki-un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bliki?hl=en
or visit the projects homepage at
http://matheclipse.org/en/Eclipse_Wikipedia_Editor