リビジョン | 100 (tree) |
---|---|
日時 | 2019-09-28 11:17:25 |
作者 | ![]() |
* flexmark-ext-inline-tags 0.1.4
flexmark 0.40.24 → flexmark 0.50.40 に変更しました。flexmarkのパッケージ名やメソッド名などAPIに変更があったため下位互換性を失っています。
@@ -1,9 +1,9 @@ | ||
1 | 1 | package net.osdn.blogs.flexmark.ext.kbd; |
2 | 2 | |
3 | -import com.vladsch.flexmark.util.ast.CustomNode; | |
3 | +import com.vladsch.flexmark.util.ast.Node; | |
4 | 4 | import com.vladsch.flexmark.util.sequence.BasedSequence; |
5 | 5 | |
6 | -public class Kbd extends CustomNode { | |
6 | +public class Kbd extends Node { | |
7 | 7 | protected BasedSequence openingMarker = BasedSequence.NULL; |
8 | 8 | protected BasedSequence text = BasedSequence.NULL; |
9 | 9 | protected BasedSequence closingMarker = BasedSequence.NULL; |
@@ -1,12 +1,12 @@ | ||
1 | 1 | package net.osdn.blogs.flexmark.ext.kbd; |
2 | 2 | |
3 | -import com.vladsch.flexmark.Extension; | |
4 | 3 | import com.vladsch.flexmark.html.HtmlRenderer; |
5 | 4 | import com.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension; |
6 | 5 | import com.vladsch.flexmark.parser.Parser; |
7 | 6 | import com.vladsch.flexmark.parser.Parser.ParserExtension; |
8 | -import com.vladsch.flexmark.util.options.MutableDataHolder; | |
9 | 7 | |
8 | +import com.vladsch.flexmark.util.builder.Extension; | |
9 | +import com.vladsch.flexmark.util.data.MutableDataHolder; | |
10 | 10 | import net.osdn.blogs.flexmark.ext.kbd.internal.KbdInlineParserExtension; |
11 | 11 | import net.osdn.blogs.flexmark.ext.kbd.internal.KbdNodeRenderer; |
12 | 12 |
@@ -7,6 +7,7 @@ | ||
7 | 7 | import com.vladsch.flexmark.parser.InlineParser; |
8 | 8 | import com.vladsch.flexmark.parser.InlineParserExtension; |
9 | 9 | import com.vladsch.flexmark.parser.InlineParserExtensionFactory; |
10 | +import com.vladsch.flexmark.parser.LightInlineParser; | |
10 | 11 | import com.vladsch.flexmark.util.sequence.BasedSequence; |
11 | 12 | |
12 | 13 | import net.osdn.blogs.flexmark.ext.kbd.Kbd; |
@@ -14,19 +15,19 @@ | ||
14 | 15 | public class KbdInlineParserExtension implements InlineParserExtension { |
15 | 16 | private final Pattern PATTERN = Pattern.compile("\\['([^']*)'\\]"); |
16 | 17 | |
17 | - public KbdInlineParserExtension(final InlineParser inlineParser) { | |
18 | + public KbdInlineParserExtension(LightInlineParser inlineParser) { | |
18 | 19 | } |
19 | 20 | |
20 | 21 | @Override |
21 | - public void finalizeDocument(final InlineParser inlineParser) { | |
22 | + public void finalizeDocument(InlineParser inlineParser) { | |
22 | 23 | } |
23 | 24 | |
24 | 25 | @Override |
25 | - public void finalizeBlock(final InlineParser inlineParser) { | |
26 | + public void finalizeBlock(InlineParser inlineParser) { | |
26 | 27 | } |
27 | 28 | |
28 | 29 | @Override |
29 | - public boolean parse(final InlineParser inlineParser) { | |
30 | + public boolean parse(LightInlineParser inlineParser) { | |
30 | 31 | if (inlineParser.peek(1) == '\'') { |
31 | 32 | BasedSequence input = inlineParser.getInput(); |
32 | 33 | Matcher matcher = inlineParser.matcher(PATTERN); |
@@ -59,12 +60,19 @@ | ||
59 | 60 | return null; |
60 | 61 | } |
61 | 62 | |
63 | + /* | |
62 | 64 | @Override |
63 | 65 | public InlineParserExtension create(final InlineParser inlineParser) { |
64 | 66 | return new KbdInlineParserExtension(inlineParser); |
65 | 67 | } |
68 | + */ | |
66 | 69 | |
67 | 70 | @Override |
71 | + public InlineParserExtension apply(LightInlineParser inlineParser) { | |
72 | + return new KbdInlineParserExtension(inlineParser); | |
73 | + } | |
74 | + | |
75 | + @Override | |
68 | 76 | public boolean affectsGlobalScope() { |
69 | 77 | return false; |
70 | 78 | } |
@@ -9,8 +9,8 @@ | ||
9 | 9 | import com.vladsch.flexmark.html.renderer.NodeRendererContext; |
10 | 10 | import com.vladsch.flexmark.html.renderer.NodeRendererFactory; |
11 | 11 | import com.vladsch.flexmark.html.renderer.NodeRenderingHandler; |
12 | -import com.vladsch.flexmark.util.options.DataHolder; | |
13 | 12 | |
13 | +import com.vladsch.flexmark.util.data.DataHolder; | |
14 | 14 | import net.osdn.blogs.flexmark.ext.kbd.Kbd; |
15 | 15 | |
16 | 16 | public class KbdNodeRenderer implements NodeRenderer { |
@@ -38,7 +38,7 @@ | ||
38 | 38 | |
39 | 39 | public static class Factory implements NodeRendererFactory { |
40 | 40 | @Override |
41 | - public NodeRenderer create(final DataHolder options) { | |
41 | + public NodeRenderer apply(DataHolder options) { | |
42 | 42 | return new KbdNodeRenderer(options); |
43 | 43 | } |
44 | 44 | } |
@@ -1,9 +1,9 @@ | ||
1 | 1 | package net.osdn.blogs.flexmark.ext.samp_button; |
2 | 2 | |
3 | -import com.vladsch.flexmark.util.ast.CustomNode; | |
3 | +import com.vladsch.flexmark.util.ast.Node; | |
4 | 4 | import com.vladsch.flexmark.util.sequence.BasedSequence; |
5 | 5 | |
6 | -public class SampButton extends CustomNode { | |
6 | +public class SampButton extends Node { | |
7 | 7 | protected BasedSequence openingMarker = BasedSequence.NULL; |
8 | 8 | protected BasedSequence text = BasedSequence.NULL; |
9 | 9 | protected BasedSequence closingMarker = BasedSequence.NULL; |
@@ -1,12 +1,12 @@ | ||
1 | 1 | package net.osdn.blogs.flexmark.ext.samp_button; |
2 | 2 | |
3 | -import com.vladsch.flexmark.Extension; | |
4 | 3 | import com.vladsch.flexmark.html.HtmlRenderer; |
5 | 4 | import com.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension; |
6 | 5 | import com.vladsch.flexmark.parser.Parser; |
7 | 6 | import com.vladsch.flexmark.parser.Parser.ParserExtension; |
8 | -import com.vladsch.flexmark.util.options.MutableDataHolder; | |
9 | 7 | |
8 | +import com.vladsch.flexmark.util.builder.Extension; | |
9 | +import com.vladsch.flexmark.util.data.MutableDataHolder; | |
10 | 10 | import net.osdn.blogs.flexmark.ext.samp_button.internal.SampButtonInlineParserExtension; |
11 | 11 | import net.osdn.blogs.flexmark.ext.samp_button.internal.SampButtonNodeRenderer; |
12 | 12 |
@@ -7,6 +7,7 @@ | ||
7 | 7 | import com.vladsch.flexmark.parser.InlineParser; |
8 | 8 | import com.vladsch.flexmark.parser.InlineParserExtension; |
9 | 9 | import com.vladsch.flexmark.parser.InlineParserExtensionFactory; |
10 | +import com.vladsch.flexmark.parser.LightInlineParser; | |
10 | 11 | import com.vladsch.flexmark.util.sequence.BasedSequence; |
11 | 12 | |
12 | 13 | import net.osdn.blogs.flexmark.ext.samp_button.SampButton; |
@@ -14,19 +15,20 @@ | ||
14 | 15 | public class SampButtonInlineParserExtension implements InlineParserExtension { |
15 | 16 | private final Pattern PATTERN = Pattern.compile("\\[\"([^\"]*)\"\\]"); |
16 | 17 | |
17 | - public SampButtonInlineParserExtension(final InlineParser inlineParser) { | |
18 | + public SampButtonInlineParserExtension(LightInlineParser inlineParser) { | |
18 | 19 | } |
19 | 20 | |
21 | + | |
20 | 22 | @Override |
21 | - public void finalizeDocument(final InlineParser inlineParser) { | |
23 | + public void finalizeDocument(InlineParser inlineParser) { | |
22 | 24 | } |
23 | 25 | |
24 | 26 | @Override |
25 | - public void finalizeBlock(final InlineParser inlineParser) { | |
27 | + public void finalizeBlock(InlineParser inlineParser) { | |
26 | 28 | } |
27 | 29 | |
28 | 30 | @Override |
29 | - public boolean parse(final InlineParser inlineParser) { | |
31 | + public boolean parse(LightInlineParser inlineParser) { | |
30 | 32 | if (inlineParser.peek(1) == '"') { |
31 | 33 | BasedSequence input = inlineParser.getInput(); |
32 | 34 | Matcher matcher = inlineParser.matcher(PATTERN); |
@@ -60,7 +62,7 @@ | ||
60 | 62 | } |
61 | 63 | |
62 | 64 | @Override |
63 | - public InlineParserExtension create(final InlineParser inlineParser) { | |
65 | + public InlineParserExtension apply(LightInlineParser inlineParser) { | |
64 | 66 | return new SampButtonInlineParserExtension(inlineParser); |
65 | 67 | } |
66 | 68 |
@@ -9,8 +9,8 @@ | ||
9 | 9 | import com.vladsch.flexmark.html.renderer.NodeRendererContext; |
10 | 10 | import com.vladsch.flexmark.html.renderer.NodeRendererFactory; |
11 | 11 | import com.vladsch.flexmark.html.renderer.NodeRenderingHandler; |
12 | -import com.vladsch.flexmark.util.options.DataHolder; | |
13 | 12 | |
13 | +import com.vladsch.flexmark.util.data.DataHolder; | |
14 | 14 | import net.osdn.blogs.flexmark.ext.samp_button.SampButton; |
15 | 15 | |
16 | 16 | public class SampButtonNodeRenderer implements NodeRenderer { |
@@ -39,7 +39,7 @@ | ||
39 | 39 | |
40 | 40 | public static class Factory implements NodeRendererFactory { |
41 | 41 | @Override |
42 | - public NodeRenderer create(final DataHolder options) { | |
42 | + public NodeRenderer apply(DataHolder options) { | |
43 | 43 | return new SampButtonNodeRenderer(options); |
44 | 44 | } |
45 | 45 | } |