sirthias/pegdown — Issue #39: Exception caused by Partial Table input
Author: OverZealous
Created: 2011-11-16 06:45:39+00:00
State: open

Here's a simple example of input that can cause an exception when Tables are enabled:

`````
| H1 | h2|
|--
`````

Also:

`````
| H1 | h2|
|--|
`````

But this works:

`````
| H1 | h2|
|--|--
`````

The exact error message is:

`````
java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
at org.parboiled.common.Preconditions.checkElementIndex(Preconditions.java:274)
at org.parboiled.common.Preconditions.checkElementIndex(Preconditions.java:254)
at org.parboiled.common.ImmutableList$SingleElementList.get(ImmutableList.java:61)
at org.pegdown.ToHtmlSerializer.visit(ToHtmlSerializer.java:234)
at org.pegdown.ast.TableCellNode.accept(TableCellNode.java:35)
at org.pegdown.ToHtmlSerializer.visitChildren(ToHtmlSerializer.java:322)
at org.pegdown.ToHtmlSerializer.printIndentedTag(ToHtmlSerializer.java:340)
at org.pegdown.ToHtmlSerializer.visit(ToHtmlSerializer.java:278)
at org.pegdown.ast.TableRowNode.accept(TableRowNode.java:25)
at org.pegdown.ToHtmlSerializer.visitChildren(ToHtmlSerializer.java:322)
at org.pegdown.ToHtmlSerializer.printIndentedTag(ToHtmlSerializer.java:340)
at org.pegdown.ToHtmlSerializer.visit(ToHtmlSerializer.java:266)
at org.pegdown.ast.TableHeaderNode.accept(TableHeaderNode.java:25)
at org.pegdown.ToHtmlSerializer.visitChildren(ToHtmlSerializer.java:322)
at org.pegdown.ToHtmlSerializer.printIndentedTag(ToHtmlSerializer.java:340)
at org.pegdown.ToHtmlSerializer.visit(ToHtmlSerializer.java:272)
at org.pegdown.ast.TableNode.accept(TableNode.java:43)
at org.pegdown.ToHtmlSerializer.visitChildren(ToHtmlSerializer.java:322)
at org.pegdown.ToHtmlSerializer.visit(ToHtmlSerializer.java:66)
at org.pegdown.ast.RootNode.accept(RootNode.java:51)
at org.pegdown.ToHtmlSerializer.toHtml(ToHtmlSerializer.java:47)
at org.pegdown.PegDownProcessor.markdownToHtml(PegDownProcessor.java:100)
at org.pegdown.PegDownProcessor.markdownToHtml(PegDownProcessor.java:88)
at org.pegdown.PegDownProcessor.markdownToHtml(PegDownProcessor.java:67)
...
`````