Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-422

XHTML to Wiki conversion of html with span followed by h4 inside an li fails

    Details

    • Similar issues:

      Description

      The following (invalid) HTML

      <ul><li><span style="">XXXX</span><h4>xxx</h4></li></ul>
      

      Fails xhtml to xwiki syntax conversion. It seems removing any of the blocks makes it work so it looks like this specific combination breaks the parser.

      org.xwiki.rendering.parser.ParseException: Failed to parse input source
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:132)
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:95)
      	at org.xwiki.rendering.test.integration.RenderingTest.runTestInternal(RenderingTest.java:130)
      	at org.xwiki.rendering.test.integration.RenderingTest.execute(RenderingTest.java:103)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.xwiki.rendering.test.integration.RenderingTestSuite$TestClassRunnerForParameters.runChild(RenderingTestSuite.java:188)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runners.Suite.runChild(Suite.java:128)
      	at org.junit.runners.Suite.runChild(Suite.java:27)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      Caused by: org.xwiki.rendering.wikimodel.WikiParserException: java.util.NoSuchElementException
      	at org.xwiki.rendering.wikimodel.xhtml.XhtmlParser.parse(XhtmlParser.java:134)
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:130)
      	... 35 more
      Caused by: java.util.NoSuchElementException
      	at java.util.ArrayDeque.removeFirst(ArrayDeque.java:278)
      	at java.util.ArrayDeque.pop(ArrayDeque.java:507)
      	at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.stopContainerBlock(EmptyBlockChainingListener.java:458)
      	at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.endFormat(EmptyBlockChainingListener.java:263)
      	at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290)
      	at org.xwiki.rendering.listener.chaining.BlockStateChainingListener.endFormat(BlockStateChainingListener.java:439)
      	at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290)
      	at org.xwiki.rendering.listener.CompositeListener.endFormat(CompositeListener.java:253)
      	at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:325)
      	at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:273)
      	at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:267)
      	at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.onWord(DefaultXWikiGeneratorListener.java:906)
      	at org.xwiki.rendering.wikimodel.impl.InternalWikiScannerContext.onWord(InternalWikiScannerContext.java:1147)
      	at org.xwiki.rendering.wikimodel.impl.WikiScannerContext.onWord(WikiScannerContext.java:597)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.flushStack(TagStack.java:205)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.onCharacters(TagStack.java:227)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.XhtmlHandler.characters(XhtmlHandler.java:180)
      	at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:588)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:487)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:480)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:357)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:335)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.endElement(XHTMLWhitespaceXMLFilter.java:200)
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.AccumulationXMLFilter.endElement(AccumulationXMLFilter.java:86)
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.DTDXMLFilter.endElement(DTDXMLFilter.java:86)
      	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
      	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
      	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
      	at org.xwiki.rendering.wikimodel.xhtml.XhtmlParser.parse(XhtmlParser.java:132)
      	... 36 more
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ludovic Ludovic Dubost
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: