CodeBaseX / wikimodel

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

MediaWikiParser - NullPointerException on two quote-blocks after empty lines #199

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
the following wiki produces a NPE:

---
paragraph

 quote line

 quote line

---

here the relevant part of the stack-trace:
java.lang.NullPointerException
    at org.wikimodel.wem.impl.InternalWikiScannerContext.beginQuotLine(InternalWikiScannerContext.java:370)
    at org.wikimodel.wem.impl.WikiScannerContext.beginQuotLine(WikiScannerContext.java:171)
    at org.wikimodel.wem.mediawiki.javacc.MediawikiScanner.quotLine(MediawikiScanner.java:932)
    at org.wikimodel.wem.mediawiki.javacc.MediawikiScanner.quot(MediawikiScanner.java:921)
    at org.wikimodel.wem.mediawiki.javacc.MediawikiScanner.docElements(MediawikiScanner.java:634)
    at org.wikimodel.wem.mediawiki.javacc.MediawikiScanner.doParse(MediawikiScanner.java:565)
    at org.wikimodel.wem.mediawiki.javacc.MediawikiScanner.parse(MediawikiScanner.java:47)
    at org.wikimodel.wem.mediawiki.MediaWikiParser.parse(MediaWikiParser.java:43)

Original issue reported on code.google.com by robert.f...@gmail.com on 11 Jan 2011 at 12:32

GoogleCodeExporter commented 9 years ago
i think the problem is that when parsing quot(), empty lines 
are not flushed via sendOnEmptyLinesEvent before fContext.beginQuot 
is called. 
they are flushed later when parsing line() (i.e. quot->quotLine->line)
which confuses the InternalWikiScannerContext.

i attached a patch which solves the problem for me, but also changes the
way quote-lines are "grouped" to quotes.

Original comment by robert.f...@gmail.com on 11 Jan 2011 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by thomas.m...@gmail.com on 11 Jul 2011 at 9:12