private void render(Node node, NodeFormatterContext context, MarkdownWriter markdown) { BasedSequence chars = node.getChars(); if (node instanceof Block) { BasedSequence contentChars = ((Block) node).getContentChars(); if (chars.isNotNull()) { BasedSequence prefix = chars.prefixOf(contentChars); if (!prefix.isEmpty()) { markdown.append(prefix); } } context.renderChildren(node); if (chars.isNotNull()) { BasedSequence suffix = chars.suffixOf(contentChars); if (!suffix.isEmpty()) { markdown.append(suffix); } } } else { if (formatterOptions.keepSoftLineBreaks) { markdown.append(chars); } else { markdown.append(stripSoftLineBreak(chars)); } } }
docx.text(node.getChars().prefixOf(node.getChildChars()).unescape()); docx.renderChildren(node); docx.text(node.getChars().suffixOf(node.getChildChars()).unescape());
html.text(node.getChars().prefixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.text(node.getChars().suffixOf(node.getChildChars()).unescape());
private void render(Node node, NodeFormatterContext context, MarkdownWriter markdown) { BasedSequence chars = node.getChars(); if (node instanceof Block) { BasedSequence contentChars = ((Block) node).getContentChars(); if (chars.isNotNull()) { BasedSequence prefix = chars.prefixOf(contentChars); if (!prefix.isEmpty()) { markdown.append(prefix); } } context.renderChildren(node); if (chars.isNotNull()) { BasedSequence suffix = chars.suffixOf(contentChars); if (!suffix.isEmpty()) { markdown.append(suffix); } } } else { if (formatterOptions.keepSoftLineBreaks) { markdown.append(chars); } else { markdown.append(stripSoftLineBreak(chars)); } } }
html.text(node.getChars().prefixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.text(node.getChars().suffixOf(node.getChildChars()).unescape());