[bliki] Issue 39 in gwtwiki: Issues when rendering french wikitionary

3 views
Skip to first unread message

gwt...@googlecode.com

unread,
May 5, 2010, 11:25:22 PM5/5/10
to bl...@googlegroups.com
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

gwt...@googlecode.com

unread,
May 6, 2010, 12:28:02 PM5/6/10
to bl...@googlegroups.com
Updates:
Status: Started
Owner: axelclk

Comment #1 on issue 39 by axelclk: Issues when rendering french wikitionary
http://code.google.com/p/gwtwiki/issues/detail?id=39

(No comment was entered for this change.)

gwt...@googlecode.com

unread,
May 6, 2010, 12:32:07 PM5/6/10
to bl...@googlegroups.com

Comment #2 on issue 39 by axelclk: Issues when rendering french wikitionary
http://code.google.com/p/gwtwiki/issues/detail?id=39

I adde part 2 of your patches to SVN:
http://code.google.com/p/gwtwiki/source/detail?r=1155

I'm not sure about part 1 at the moment, because a JUnit test fails if I
change the
sources as suggested.

gwt...@googlecode.com

unread,
Jul 3, 2012, 1:40:28 PM7/3/12
to bl...@googlegroups.com
Updates:
Status: Fixed
Labels: Mediawiki2HTML

Comment #3 on issue 39 by axe...@gmail.com: Issues when rendering french
wikitionary
http://code.google.com/p/gwtwiki/issues/detail?id=39
Reply all
Reply to author
Forward
0 new messages