RootNode rootNode = result.getRootNode();
int extensions = result.getExtensions();
if (rootNode != null) {
FileObject file = pr.getSnapshot().getSource().getFileObject();
MarkdownTOCVisitor visitor = new MarkdownTOCVisitor(file);
rootNode.accept(visitor);
MarkdownTOCRootItem tocRootItem
= new MarkdownTOCRootItem(file, rootNode, visitor.getTOCEntryItems());
MarkdownReferencesRootItem refsRootItem
= new MarkdownReferencesRootItem(file, rootNode);