Refine search
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); state.nodeAdded(decorationNode); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); state.nodeRemoved(node);
@Override public void process(NodeTracker state, Node node) { if (node instanceof Link) { Node previous = node.getPrevious(); if (previous instanceof Text) { final BasedSequence chars = previous.getChars(); if (chars.endsWith("@") && chars.isContinuedBy(node.getChars())) { int prevBackslash = chars.subSequence(0, chars.length() - 1).countTrailing('\\'); if ((prevBackslash & 1) == 0) { // trim previous chars to remove '@' previous.setChars(chars.subSequence(0, chars.length() - 1)); YouTubeLink youTubeLink = new YouTubeLink((Link) node); youTubeLink.takeChildren(node); node.unlink(); previous.insertAfter(youTubeLink); state.nodeRemoved(node); state.nodeAddedWithChildren(youTubeLink); } } } } }
static void textBaseWrap(final NodeTracker state, Node lastNonAttributesNode, final Node lastNode, final TextBase textBase) { while (lastNonAttributesNode != lastNode) { Node nextNode = lastNonAttributesNode.getNext(); lastNonAttributesNode.unlink(); state.nodeRemoved(lastNonAttributesNode); textBase.appendChild(lastNonAttributesNode); lastNonAttributesNode = nextNode; } textBase.setCharsFromContent(); lastNode.insertBefore(textBase); state.nodeAddedWithDescendants(textBase); }
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); node.insertBefore(node1); state.nodeAdded(node1); node.insertBefore(linkNode); state.nodeAddedWithChildren(linkNode); Node next = removeNode.getNext(); removeNode.unlink(); state.nodeRemoved(removeNode); node.insertBefore(node1); state.nodeAdded(node1); state.nodeRemoved(node);
@Override public void nodeAdded(Node node) { validateLinked(node); myNodeClassifier.add(node); if (myHost != null) myHost.nodeAdded(node); }
next = next.getNext(); tmp.unlink(); state.nodeRemoved(tmp); } else { next.setChars(next.getChars().trimStart()); previous = previous.getPrevious(); tmp.unlink(); state.nodeRemoved(tmp); } else { previous.setChars(previous.getChars().trimEnd());
@Override public void nodeAddedWithChildren(Node node) { validateLinked(node); myNodeClassifier.add(node); addNodes(node.getChildren()); if (myHost != null) myHost.nodeAddedWithChildren(node); }
@Override public void nodeAddedWithDescendants(Node node) { validateLinked(node); myNodeClassifier.add(node); addNodes(node.getDescendants()); if (myHost != null) myHost.nodeAddedWithDescendants(node); }
@Override public void nodeRemovedWithDescendants(Node node) { validateUnlinked(node); myNodeClassifier.add(node); removeNodes(node.getDescendants()); if (myHost != null) myHost.nodeRemovedWithDescendants(node); }
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); node.insertBefore(node1); state.nodeAdded(node1); node.insertBefore(linkNode); state.nodeAddedWithChildren(linkNode); Node next = removeNode.getNext(); removeNode.unlink(); state.nodeRemoved(removeNode); node.insertBefore(node1); state.nodeAdded(node1); state.nodeRemoved(node);
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); } } }
next = next.getNext(); tmp.unlink(); state.nodeRemoved(tmp); } else { next.setChars(next.getChars().trimStart()); previous = previous.getPrevious(); tmp.unlink(); state.nodeRemoved(tmp); } else { previous.setChars(previous.getChars().trimEnd());
@Override public void nodeAddedWithChildren(Node node) { validateLinked(node); myNodeClassifier.add(node); addNodes(node.getChildren()); if (myHost != null) myHost.nodeAddedWithChildren(node); }
@Override public void nodeAddedWithDescendants(Node node) { validateLinked(node); myNodeClassifier.add(node); addNodes(node.getDescendants()); if (myHost != null) myHost.nodeAddedWithDescendants(node); }
@Override public void nodeRemovedWithDescendants(Node node) { validateUnlinked(node); myNodeClassifier.add(node); removeNodes(node.getDescendants()); if (myHost != null) myHost.nodeRemovedWithDescendants(node); }
state.nodeRemoved(node); previous.insertAfter(mediaLink); state.nodeAddedWithChildren(mediaLink); previous.setChars(chars.subSequence(0, chars.length() - mediaLink.getPrefix().length())); if (previous.getChars().length() == 0) { previous.unlink(); state.nodeRemoved(previous);
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); state.nodeAdded(decorationNode); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); state.nodeRemoved(node);
@Override public void process(NodeTracker state, Node node) { if (node instanceof Heading) { if (node.isOrDescendantOfType(BlockQuote.class)) { int tmp = 0; } Heading heading = (Heading) node; if (heading.getText().isNotNull()) { Node anchor = new AnchorLink(); if (!options.wrapText) { if (heading.getFirstChild() == null) { anchor.setChars(heading.getText().subSequence(0, 0)); heading.appendChild(anchor); } else { anchor.setChars(heading.getFirstChild().getChars().subSequence(0, 0)); heading.getFirstChild().insertBefore(anchor); } } else { anchor.takeChildren(heading); heading.appendChild(anchor); } anchor.setCharsFromContent(); state.nodeAdded(anchor); } } else { int tmp = 0; } }
static void textBaseWrap(final NodeTracker state, Node lastNonAttributesNode, final Node lastNode, final TextBase textBase) { while (lastNonAttributesNode != lastNode) { Node nextNode = lastNonAttributesNode.getNext(); lastNonAttributesNode.unlink(); state.nodeRemoved(lastNonAttributesNode); textBase.appendChild(lastNonAttributesNode); lastNonAttributesNode = nextNode; } textBase.setCharsFromContent(); lastNode.insertBefore(textBase); state.nodeAddedWithDescendants(textBase); }
previous.insertBefore(textBase); previous.unlink(); state.nodeRemoved(previous); state.nodeAddedWithChildren(textBase); attributeOwner = textBase; } else if (previous instanceof AttributesDelimiter) {