Description
If one has a page with the following contents:
{{toc/}} == Rubbish [[attach:]]Link ==
then the TOC macro fails with the following error message:
java.lang.IndexOutOfBoundsException: Index: 0 at java.base/java.util.Collections$EmptyList.get(Collections.java:4483) at org.xwiki.rendering.block.PlainTextBlockFilter.filterLinkBlock(PlainTextBlockFilter.java:103) at org.xwiki.rendering.block.PlainTextBlockFilter.filter(PlainTextBlockFilter.java:84) at org.xwiki.rendering.block.AbstractBlock.clone(AbstractBlock.java:520) at org.xwiki.rendering.internal.macro.toc.TocBlockFilter.generateLabel(TocBlockFilter.java:54) at org.xwiki.rendering.internal.macro.toc.TocTreeBuilder.createTocEntry(TocTreeBuilder.java:193) at org.xwiki.rendering.internal.macro.toc.TocTreeBuilder.addItemBlock(TocTreeBuilder.java:166) at org.xwiki.rendering.internal.macro.toc.TocTreeBuilder.generateTree(TocTreeBuilder.java:145) at org.xwiki.rendering.internal.macro.toc.TocTreeBuilder.build(TocTreeBuilder.java:95) at org.xwiki.rendering.internal.macro.toc.AbstractTocMacro.execute(AbstractTocMacro.java:122) at org.xwiki.rendering.internal.macro.toc.AbstractTocMacro.execute(AbstractTocMacro.java:49) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:297)
Of course the empty [[attach:]] link is totally useless, but I think it should not make the macro fail, it should just ignore it.