本文整理汇总了Java中org.pegdown.ast.RefImageNode类的典型用法代码示例。如果您正苦于以下问题:Java RefImageNode类的具体用法?Java RefImageNode怎么用?Java RefImageNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RefImageNode类属于org.pegdown.ast包,在下文中一共展示了RefImageNode类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: process
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
RefImageNode refImage = (RefImageNode) node;
@SuppressWarnings("unchecked")
TextNode text = (TextNode) lookupChild(refImage.referenceKey, TextNode.class);
if (text == null) {
log.warn("Unknown reference image structure... {}", refImage);
context.processChildren(level, node);
return;
}
References.Ref ref = context.references().lookup(text.getText());
if (ref != null) {
Node altNode = refImage.getChildren().get(0);
context.process(level, new ExpImageNode(ref.title(), ref.url(), altNode));
return;
}
log.warn("Reference not found for image {}", text.getText());
}
开发者ID:Arnauld,项目名称:gutenberg,代码行数:23,代码来源:RefImageNodeProcessor.java
示例2: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(final RefImageNode rin) {
final ArrayList<String> alt = new ArrayList<String>();
boolean found = findByClass(rin, TextNode.class, new FindPredicate<TextNode>() {
@Override
public boolean f(TextNode node, Node parent, int index) {
alt.add(node.getText());
return true;
}
});
if (!found) {
throw new IllegalStateException("The alt name should be mandatory in Markdown for images. ");
}
final SuperNode referenceKey = rin.referenceKey;
final String ref = getRefString(rin, referenceKey);
String url = ref;
String title = null;
ReferenceNode referenceNode = referenceNodes.get(ref);
if (referenceNode != null) {
if (isNotBlank(referenceNode.getUrl())) {
url = referenceNode.getUrl();
}
title = referenceNode.getTitle();
}
String titlePart = isNotBlank(title) ? format("|title=\"%s\"", title) : "";
_buffer.append( format( "!%s|alt=\"%s\"%s!", url, alt.get(0), titlePart));
}
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:33,代码来源:ToConfluenceSerializer.java
示例3: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
public void visit(final RefImageNode node) {
}
开发者ID:miurahr,项目名称:omegat-markdown-plugin,代码行数:3,代码来源:AbstractMarkdownSerializer.java
示例4: usecase__ancestor_sibling_and_of_type
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void usecase__ancestor_sibling_and_of_type() throws Exception {
String mkd = loadResource("image-04-ref.md").trim();
PegDownPlugins plugins = PegDownPlugins
.builder()
.withPlugin(AttributesPlugin.class)
.build();
PegDownProcessor processor = new PegDownProcessor(Extensions.ALL, plugins);
RootNode rootNode = processor.parseMarkdown(mkd.toCharArray());
TreeNavigation nav;
nav = new TreeNavigation();
nav.push(rootNode);
nav.pushChild(3);
nav.pushChild();
nav.pushChild();
assertThat(nav.peek()).isInstanceOf(RefImageNode.class);
//
//
Optional<TreeNavigation> result1 =
ancestor(RefImageNode.class, SuperNode.class, ParaNode.class)
.query(nav);
assertThat(result1.isPresent()).isTrue();
assertThat(result1.get().peek()).isInstanceOf(ParaNode.class);
//
//
Optional<TreeNavigation> result2 =
ancestor(RefImageNode.class, SuperNode.class, ParaNode.class)
.then(siblingBefore())
.query(nav);
assertThat(result2.isPresent()).isTrue();
assertThat(result2.get().peek()).isInstanceOf(AttributesNode.class);
//
//
Optional<TreeNavigation> result3 =
firstAncestorOfType(ParaNode.class)
.then(siblingBefore())
.query(nav);
assertThat(result3.isPresent()).isTrue();
assertThat(result3.get().peek()).isInstanceOf(AttributesNode.class);
//System.out.println("TreeNavigationTest.usecase" + dumpAST(rootNode));
}
开发者ID:Arnauld,项目名称:gutenberg,代码行数:49,代码来源:TreeNavigationTest.java
示例5: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(RefImageNode arg0) {
// TODO Auto-generated method stub
}
开发者ID:daisy,项目名称:pipeline-gui,代码行数:6,代码来源:MarkdownToJavafx.java
示例6: render
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public Rendering render (final RefImageNode node, final String url, final String title, final String alt) {
return modifyRendering (super.render (node, url, title, alt));
}
开发者ID:IDgis,项目名称:geo-publisher,代码行数:5,代码来源:Docs.java
示例7: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override public void visit(RefImageNode node) {
//To change body of implemented methods use File | Settings | File Templates.
}
开发者ID:mindsnacks,项目名称:penmanship,代码行数:4,代码来源:BaseVisitor.java
示例8: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(RefImageNode node) {
}
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:DocTestingVisitor.java
示例9: visit
import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(@NotNull RefImageNode node) {
}
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:CodeExtractionVisitor.java
注:本文中的org.pegdown.ast.RefImageNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论