@Override protected String toStringAttributes() { return "text=" + getChars(); } }
private void render(final Text node, final DocxRendererContext docx) { docx.text(node.getChars().unescape()); /* // add text to last R R r = docx.getR(); final org.docx4j.wml.Text text = docx.addWrappedText(r); text.setValue(node.getChars().unescape()); text.setSpace(RunFormatProvider.SPACE_PRESERVE); */ }
private void visit(Text node) { if (!node.isOrDescendantOfType(DoNotCollectText.class)) { out.append(node.getChars()); } }
private void visit(Text node) { if (!node.isOrDescendantOfType(DoNotCollectText.class)) { out.append(node.getChars()); } }
@Override public Node unmatchedDelimiterNode(InlineParser inlineParser, final DelimiterRun delimiter) { if (myUnmatched != null && myOptions.typographicSmarts) { BasedSequence chars = delimiter.getNode().getChars(); if (chars.length() == 1) { return new TypographicSmarts(chars, myUnmatched); } } return null; }
@SuppressWarnings("MethodMayBeStatic") void render(Text node, NodeRendererContext context, HtmlWriter html) { html.text(Escaping.normalizeEOL(node.getChars().unescape())); }
private void render(Text node, NodeFormatterContext context, MarkdownWriter markdown) { //if (TABLE_HEADER_SEPARATOR.matcher(node.getChars()).matches()) { if (myTable != null && myTable.isSeparator()) { Node parent = node.getAncestorOfType(Paragraph.class); if (parent instanceof Paragraph && ((Paragraph) parent).hasTableSeparator()) { markdown.pushPrefix().addPrefix(" ").append(node.getChars()).popPrefix(); } else { markdown.append(node.getChars()); } } else { markdown.append(node.getChars()); } }
private void render(Text node, NodeRendererContext context, HtmlWriter html) { html.raw(Escaping.normalizeEOL(node.getChars().unescape())); }
private void render(Text node, NodeRendererContext context, HtmlWriter html) { html.raw(Escaping.normalizeEOL(node.getChars().unescape())); }
@Override public void mergeIfNeeded(Text first, Text last) { if (first != null && last != null && first != last) { ArrayList<BasedSequence> sb = new ArrayList<BasedSequence>(); sb.add(first.getChars()); Node node = first.getNext(); Node stop = last.getNext(); while (node != stop) { sb.add(node.getChars()); Node unlink = node; node = node.getNext(); unlink.unlink(); } BasedSequence literal = SegmentedSequence.of(sb); first.setChars(literal); } }
protected boolean canOpen(final DelimiterRun opener, final int minLength) { if (opener.canOpen()) { BasedSequence openerChars = opener.getNode().getChars(); if (opener.getPrevious() != null && opener.getPrevious().getNode().getChars().isContinuationOf(openerChars) || openerChars.getStartOffset() == 0 || isAllowed(openerChars.getBaseSequence(), openerChars.getStartOffset() - minLength)) { return true; } } return false; }
private void processText(NodeTracker state, Text node) { BasedSequence original = node.getChars(); boolean wrapInTextBase = !(node.getParent() instanceof TextBase); TextBase textBase = null; while (wrapInTextBase) { if (wrapInTextBase) { wrapInTextBase = false; textBase = new TextBase(original); node.insertBefore(textBase); textBase.appendChild(node); state.nodeAdded(textBase); } } }
private void visit(Text node) { if (!node.isOrDescendantOfType(DoNotDecorate.class)) { // do some processing BasedSequence original = node.getChars(); boolean wrapInTextBase = !(node.getParent() instanceof TextBase); TextBase textBase = null; while (wrapInTextBase) { if (wrapInTextBase) { wrapInTextBase = false; textBase = new TextBase(original); node.insertBefore(textBase); textBase.appendChild(node); } } } }
protected boolean canClose(final DelimiterRun closer, final int minLength) { if (closer.canClose()) { BasedSequence closerChars = closer.getNode().getChars(); if (closer.getNext() != null && closerChars.isContinuationOf(closer.getNext().getNode().getChars()) || closerChars.getEndOffset() >= closerChars.getBaseSequence().length() || isAllowed(closerChars.getBaseSequence(), closerChars.getEndOffset() + minLength - 1)) { return true; } } return false; }
BasedSequence literal = text.getChars(); Matcher matcher = myParsing.FINAL_SPACE.matcher(literal); int spaces = matcher.find() ? matcher.end() - matcher.start() - crLfDelta : 0; if (crLf && lastChild instanceof Text) { Text text = (Text) lastChild; BasedSequence literal = text.getChars(); if (literal.length() > 1) { lastChild.setChars(literal.subSequence(0, literal.length() - crLfDelta).trimEnd());
private void visit(Text node) { if (!node.isOrDescendantOfType(DoNotCollectText.class)) { out.append(node.getChars()); } }
if (!linkRefProcessorMatch.wantExclamation && isImage) { appendText(input.subSequence(opener.getStartIndex() - 1, opener.getStartIndex())); opener.getNode().setChars(opener.getNode().getChars().subSequence(1));