本文整理汇总了Java中org.pegdown.ast.CodeNode类的典型用法代码示例。如果您正苦于以下问题:Java CodeNode类的具体用法?Java CodeNode怎么用?Java CodeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeNode类属于org.pegdown.ast包,在下文中一共展示了CodeNode类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override
public void visit(CodeNode cn) {
final String text = cn.getText();
final String lines[] = text.split("\n");
if( lines.length == 1 ) {
_buffer.append( "{{")
.append(text
.replace("{", "\\{")
.replace("}", "\\}"))
.append( "}}");
return;
}
_buffer
.append( "\n{code}")
.append('\n')
.append(text)
.append( "{code}")
.append('\n')
;
}
示例2: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
/**
* Accept Code node.
*
* @param node
*/
@Override
public void visit(final CodeNode node) {
int textLen = node.getText().length();
int nodeLen = node.getEndIndex() - node.getStartIndex();
int markLen = (nodeLen - textLen) / 2; // FIXME: odd?
String startmark = handler.getChars(node.getStartIndex(), markLen);
String endmark = handler.getChars(node.getEndIndex() - markLen, markLen);
handler.startPara(MarkdownState.NORMAL);
handler.putMark(startmark);
handler.putEntry(node);
handler.putMark(endmark);
handler.endPara();
}
示例3: process
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
CodeNode cNode = (CodeNode) node;
Font font = styles.getFont(Styles.INLINE_CODE_FONT).or(inlineCodeFont(styles));
List<Element> elements = context.iTextContext().emitButCollectElements(new RichText(cNode.getText(), font));
for (Element element : elements) {
if (element instanceof Chunk) {
Chunk chunk = (Chunk) element;
chunk.setBackground(styles.getColor(Styles.INLINE_CODE_BACKGROUND).or(BaseColor.GRAY));
chunk.setGenericTag("code");
}
context.append(element);
}
}
示例4: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
public void visit(final CodeNode node) {
}
示例5: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override
public void visit(CodeNode code) {
Text elem =new Text(code.getText());
elem.getStyleClass().add("code");
this.parent.addChild(elem);
}
示例6: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override public void visit(CodeNode node) {
//To change body of implemented methods use File | Settings | File Templates.
}
示例7: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override
public void visit(CodeNode node) {
}
示例8: visit
import org.pegdown.ast.CodeNode; //导入依赖的package包/类
@Override
public void visit(@NotNull CodeNode node) {
}