boolean wrapFirstItemInPara(SuperNode item) { Node firstItemFirstChild = item.getChildren().get(0); ParaNode paraNode = new ParaNode(firstItemFirstChild.getChildren()); paraNode.setStartIndex(firstItemFirstChild.getStartIndex()); paraNode.setEndIndex(firstItemFirstChild.getEndIndex()); // vsch: wrap the para in RootNode so that it is identical to the rest of the list items if they are loose, otherwise it creates differences in html serialization of task items RootNode rootNode = new RootNode(); rootNode.setStartIndex(paraNode.getStartIndex()); rootNode.setEndIndex(paraNode.getEndIndex()); rootNode.getChildren().add(paraNode); item.getChildren().set(0, rootNode); return true; }
public Rule Para() { return NodeSequence( // The Para Rule only tests for the presence of a following blank line, but does not consume it. // this means that phantom \n's will not be part of the node's source range, except when // the input had no EOL's at the end at all, even then only one of these will be included NonindentSpace(), Inlines(), push(new ParaNode(popAsNode())), Test(BlankLine()) ); }