Revision | 107 (tree) |
---|---|
Time | 2020-05-22 12:00:47 |
Author | hirukawa_ryo |
* flexmark-ext-highlight 0.3
flexmark 0.61.32 に追従しました。
flexmarkの仕様ころころと変わり過ぎです!
@@ -4,10 +4,10 @@ | ||
4 | 4 | import com.vladsch.flexmark.html.HtmlRenderer.Builder; |
5 | 5 | import com.vladsch.flexmark.html.renderer.NodeRenderer; |
6 | 6 | import com.vladsch.flexmark.html.renderer.NodeRendererFactory; |
7 | -import com.vladsch.flexmark.util.builder.Extension; | |
8 | 7 | import com.vladsch.flexmark.util.data.DataHolder; |
9 | 8 | import com.vladsch.flexmark.util.data.DataKey; |
10 | 9 | import com.vladsch.flexmark.util.data.MutableDataHolder; |
10 | +import com.vladsch.flexmark.util.misc.Extension; | |
11 | 11 | |
12 | 12 | public class HighlightExtension implements HtmlRenderer.HtmlRendererExtension { |
13 | 13 | public static final DataKey<Boolean> REPLACE_YEN_SIGN = new DataKey<>("REPLACE_YEN_SIGN", true); |
@@ -11,7 +11,6 @@ | ||
11 | 11 | import com.codewaves.codehighlight.core.StyleRendererFactory; |
12 | 12 | import com.codewaves.codehighlight.renderer.HtmlRenderer; |
13 | 13 | import com.vladsch.flexmark.ast.FencedCodeBlock; |
14 | -import com.vladsch.flexmark.html.CustomNodeRenderer; | |
15 | 14 | import com.vladsch.flexmark.html.HtmlWriter; |
16 | 15 | import com.vladsch.flexmark.html.renderer.AttributablePart; |
17 | 16 | import com.vladsch.flexmark.html.renderer.NodeRenderer; |
@@ -19,6 +18,7 @@ | ||
19 | 18 | import com.vladsch.flexmark.html.renderer.NodeRenderingHandler; |
20 | 19 | import com.vladsch.flexmark.parser.Parser; |
21 | 20 | import com.vladsch.flexmark.util.data.DataHolder; |
21 | +import com.vladsch.flexmark.util.misc.CharPredicate; | |
22 | 22 | import com.vladsch.flexmark.util.sequence.BasedSequence; |
23 | 23 | |
24 | 24 | public class HighlightRenderer implements NodeRenderer { |
@@ -51,14 +51,14 @@ | ||
51 | 51 | }); |
52 | 52 | |
53 | 53 | public HighlightRenderer(DataHolder options) { |
54 | - codeContentBlock = Parser.FENCED_CODE_CONTENT_BLOCK.getFrom(options); | |
55 | - isReplaceYenSign = HighlightExtension.REPLACE_YEN_SIGN.getFrom(options); | |
54 | + codeContentBlock = Parser.FENCED_CODE_CONTENT_BLOCK.get(options); | |
55 | + isReplaceYenSign = HighlightExtension.REPLACE_YEN_SIGN.get(options); | |
56 | 56 | } |
57 | 57 | |
58 | 58 | @Override |
59 | 59 | public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() { |
60 | 60 | Set<NodeRenderingHandler<?>> set = new HashSet<NodeRenderingHandler<?>>(); |
61 | - set.add(new NodeRenderingHandler<FencedCodeBlock>(FencedCodeBlock.class, new CustomNodeRenderer<FencedCodeBlock>() { | |
61 | + set.add(new NodeRenderingHandler<FencedCodeBlock>(FencedCodeBlock.class, new NodeRenderingHandler.CustomNodeRenderer<FencedCodeBlock>() { | |
62 | 62 | @Override |
63 | 63 | public void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { |
64 | 64 | HighlightRenderer.this.render(node, context, html); |
@@ -118,7 +118,7 @@ | ||
118 | 118 | } |
119 | 119 | |
120 | 120 | if (info.isNotNull() && !info.isBlank()) { |
121 | - int space = info.indexOfAny(" "); | |
121 | + int space = info.indexOfAny(CharPredicate.SPACE); | |
122 | 122 | if (space == -1) { |
123 | 123 | language = info; |
124 | 124 | } else { |