-
Notifications
You must be signed in to change notification settings - Fork 299
Expand file tree
/
Copy pathResizableImageSample.java
More file actions
27 lines (21 loc) · 1.13 KB
/
ResizableImageSample.java
File metadata and controls
27 lines (21 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.vladsch.flexmark.java.samples;
import com.vladsch.flexmark.ext.resizable.image.ResizableImageExtension;
import com.vladsch.flexmark.ext.resizable.image.internal.ResizableImageInlineParserExtension;
import com.vladsch.flexmark.ext.resizable.image.internal.ResizableImageNodeRenderer;
import com.vladsch.flexmark.html.HtmlRenderer;
import com.vladsch.flexmark.parser.Parser;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.data.MutableDataSet;
import java.util.Arrays;
import java.util.Collections;
public class ResizableImageSample {
public static void main(String[] args) {
MutableDataSet options = new MutableDataSet();
options.set(Parser.EXTENSIONS, Arrays.asList(ResizableImageExtension.create()));
Parser parser = Parser.builder(options).build();
HtmlRenderer renderer = HtmlRenderer.builder(options).build();
Node document = parser.parse("");
String html = renderer.render(document);
System.out.println(html);
}
}