weihe08 / wikimodel

Automatically exported from code.google.com/p/wikimodel
0 stars 0 forks source link

MediaWiki parser does not parse nested <ref name=thename>the value</ref> constructs correctly #168

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The media wiki syntax has a pseudo (invalid) <ref/> tag construct to 
encapsulate inline sections of the markup content to build internal 
reference links. Those constructs are not parsed by the parser as the 
following test shows:

Index: src/test/java/org/wikimodel/wem/test/MediawikiParserTest.java
===================================================================
--- src/test/java/org/wikimodel/wem/test/MediawikiParserTest.java       
(revision 436)
+++ src/test/java/org/wikimodel/wem/test/MediawikiParserTest.java       
(working copy)
@@ -249,6 +249,8 @@
        test("before [#local ancor] after");

        test("not [[a reference] at all!");
+
+        test("<ref name=definitions>test wikimedia reference</ref>");
    }

    /**

That outputs:

==================================================
<div class='wikimodel-document'>
<p>&lt;ref name=definitions&gt;test wikimedia reference</p>
</div>

E.g. it does not seem to be handled at all.

FYI, ref tags can have formatted content such as the following excert
fromt the Anarchism article of the english wikipedia:

<ref name=definitions>*[[Errico Malatesta]],
\"[http://www.marxists.org/archive/malatesta/1930s/xx/toanarchy.htm
Towards Anarchism]\", ''MAN!''. [[Los Angeles]]: International Group
of San Francisco. {{OCLC|3930443}}. *{{cite journal
|url=http://www.theglobeandmail.com/servlet/story/RTGAM.20070514.wxlanarchis
t14/BNStory/lifeWork/home/
|title=Working for The Man |journal=[[The Globe and Mail]]
|accessdate=2008-04-14 |last=Agrell |first=Siri |date=2007-05-14}}
*\"[http://www.britannica.com/eb/article-9117285 Anarchism].\"
''Encyclopædia Britannica''. 2006. Encyclopædia Britannica Premium
Service. 29 August 2006 *\"Anarchism.\" ''The Shorter [[Routledge
Encyclopedia of Philosophy]]''. 2005. p. 14 \"Anarchism is the view
that a society without the state, or government, is both possible and
desirable.\"</ref>

Original issue reported on code.google.com by olivier....@gmail.com on 7 Jan 2010 at 6:02

GoogleCodeExporter commented 9 years ago
Applied patch from Arun Reddy

References as Image labels not fixed.
[[ Image:image.png | [[ IMAGE_REF | This is Image]] ]]

Original comment by thomas.m...@gmail.com on 28 Mar 2010 at 5:58

GoogleCodeExporter commented 9 years ago

Original comment by thomas.m...@gmail.com on 29 Sep 2010 at 1:49