本文整理汇总了Java中com.vladsch.flexmark.ast.Node.unlink方法的典型用法代码示例。如果您正苦于以下问题:Java Node.unlink方法的具体用法?Java Node.unlink怎么用?Java Node.unlink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vladsch.flexmark.ast.Node
的用法示例。
在下文中一共展示了Node.unlink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.vladsch.flexmark.ast.Node; //导入方法依赖的package包/类
@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();
//Se o nó anterior termina com '#' e é seguido pelo Link
if (chars.endsWith("#") && chars.isContinuedBy(node.getChars())) {
//Remove o caractere '#' do nó anterior.
previous.setChars(chars.subSequence(0, chars.length() - 1));
Twitter videoLink = new Twitter((Link) node);
videoLink.takeChildren(node);
node.unlink();
previous.insertAfter(videoLink);
state.nodeRemoved(node);
state.nodeAddedWithChildren(videoLink);
}
}
}
}
示例2: process
import com.vladsch.flexmark.ast.Node; //导入方法依赖的package包/类
@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();
//Se o nó anterior termina com 'B' e é seguido pelo Link
if (chars.endsWith("B") && chars.isContinuedBy(node.getChars())) {
//Remove o caractere 'B' do nó anterior.
previous.setChars(chars.subSequence(0, chars.length() - 1));
Button btn = new Button((Link) node);
btn.takeChildren(node);
node.unlink();
previous.insertAfter(btn);
state.nodeRemoved(node);
state.nodeAddedWithChildren(btn);
}
}
}
}
示例3: process
import com.vladsch.flexmark.ast.Node; //导入方法依赖的package包/类
@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();
//Se o nó anterior termina com '@' e é seguido pelo Link
if (chars.endsWith("@") && chars.isContinuedBy(node.getChars())) {
//Remove o caractere '@' do nó anterior.
previous.setChars(chars.subSequence(0, chars.length() - 1));
VideoLink videoLink = new VideoLink((Link) node);
videoLink.takeChildren(node);
node.unlink();
previous.insertAfter(videoLink);
state.nodeRemoved(node);
state.nodeAddedWithChildren(videoLink);
}
}
}
}