Skip to content

Commit eb1f262

Browse files
committed
fix vsch#27
1 parent f106a5c commit eb1f262

59 files changed

Lines changed: 736 additions & 968 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/HtmlFormattingAppendableImplTest.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 475 additions & 707 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VERSION.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ flexmark-java
77

88
- [This Release **To Do List**](#this-release-to-do-list)
99
- [Next Release To Do List](#next-release-to-do-list)
10+
- [0.9.1](#091)
1011
- [0.9.0](#090)
1112
- [0.8.0](#080)
1213
- [0.7.0](#070)
@@ -95,6 +96,16 @@ Next Release To Do List
9596
- [x] Markdown.pl (default for family)
9697
- [ ] Php Markdown Extra
9798

99+
0.9.1
100+
-----
101+
102+
- Fix: #27, Abbreviation node not called when 2 abbreviations, was expecting \n even at end of
103+
file.
104+
105+
- Add: `RenderingTestCase.NO_FILE_EOL` option `NO_FILE_EOL` to test cases which will strip out
106+
the last EOL of example in a spec to simulate input without trailing EOL. Otherwise all test
107+
cases had trailing EOL.
108+
98109
0.9.0
99110
-----
100111

flexmark-ext-abbreviation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.vladsch.flexmark</groupId>
66
<artifactId>flexmark-java</artifactId>
7-
<version>0.9.0</version>
7+
<version>0.9.1</version>
88
</parent>
99

1010
<artifactId>flexmark-ext-abbreviation</artifactId>

flexmark-ext-abbreviation/src/main/java/com/vladsch/flexmark/ext/abbreviation/internal/AbbreviationParagraphPreProcessor.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
import java.util.regex.Pattern;
1919

2020
public class AbbreviationParagraphPreProcessor implements ParagraphPreProcessor {
21-
private static Pattern ABBREVIATION_BLOCK = Pattern.compile("\\s{0,3}(\\*\\[\\s*.*\\s*\\]:)\\s*[^\n\r]*(?:\r\n|\r|\n)");
21+
private static Pattern ABBREVIATION_BLOCK = Pattern.compile("\\s{0,3}(\\*\\[\\s*.*\\s*\\]:)\\s*[^\n\r]*(?:\r\n|\r|\n|$)");
2222

23+
@SuppressWarnings("FieldCanBeLocal")
2324
private final AbbreviationOptions options;
2425
private final AbbreviationRepository abbreviationMap;
2526

26-
AbbreviationParagraphPreProcessor(DataHolder options) {
27+
private AbbreviationParagraphPreProcessor(DataHolder options) {
2728
this.options = new AbbreviationOptions(options);
2829
abbreviationMap = options.get(AbbreviationExtension.ABBREVIATIONS);
2930
}
@@ -35,10 +36,10 @@ public int preProcessBlock(Paragraph block, ParserState state) {
3536
int lastFound = 0;
3637
while (matcher.find()) {
3738
// abbreviation definition
38-
if (matcher.start() != lastFound) break;
39-
39+
if (matcher.start() != lastFound) break;
40+
4041
lastFound = matcher.end();
41-
42+
4243
int openingStart = matcher.start(1);
4344
int openingEnd = matcher.end(1);
4445
int textEnd = lastFound;
@@ -52,15 +53,15 @@ public int preProcessBlock(Paragraph block, ParserState state) {
5253
abbreviationBlock.setClosingMarker(closingMarker);
5354
abbreviationBlock.setAbbreviation(trySequence.subSequence(openingEnd, textEnd).trim());
5455
abbreviationBlock.setCharsFromContent();
55-
56+
5657
block.insertBefore(abbreviationBlock);
5758
state.blockAdded(abbreviationBlock);
58-
59+
5960
abbreviationMap.put(abbreviationMap.normalizeKey(abbreviationBlock.getText()), abbreviationBlock);
6061
}
6162
return lastFound;
6263
}
63-
64+
6465
public static ParagraphPreProcessorFactory Factory() {
6566
return new ParagraphPreProcessorFactory() {
6667
@Override

flexmark-ext-abbreviation/src/test/resources/ext_abbreviation_ast_spec.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ Document[0, 21]
2222
````````````````````````````````
2323

2424

25-
```````````````````````````````` example Abbreviation: 2
25+
Should work without trailing EOL
26+
27+
```````````````````````````````` example(Abbreviation: 2) options(NO_FILE_EOL)
28+
*[Abbr]:Abbreviation
29+
.
30+
.
31+
Document[0, 20]
32+
AbbreviationBlock[0, 20] open:[0, 2] text:[2, 6] close:[6, 8] abbreviation:[8, 20]
33+
````````````````````````````````
34+
35+
36+
```````````````````````````````` example Abbreviation: 3
2637
*[Abbr]:Abbreviation
2738
2839
This has an Abbr embedded in it.
@@ -41,7 +52,7 @@ Document[0, 55]
4152

4253
No inline processing in expansion text.
4354

44-
```````````````````````````````` example Abbreviation: 3
55+
```````````````````````````````` example Abbreviation: 4
4556
*[Abbr]: Abbreviation has *emphasis*, **bold** or `code`
4657
4758
This has an Abbr embedded in it.
@@ -58,7 +69,7 @@ Document[0, 91]
5869
````````````````````````````````
5970

6071

61-
```````````````````````````````` example(Abbreviation: 4) options(links)
72+
```````````````````````````````` example(Abbreviation: 5) options(links)
6273
*[Abbr]: Abbreviation has *emphasis*, **bold** or `code`
6374
6475
This has an Abbr embedded in it.
@@ -75,7 +86,7 @@ Document[0, 91]
7586
````````````````````````````````
7687

7788

78-
```````````````````````````````` example Abbreviation: 5
89+
```````````````````````````````` example Abbreviation: 6
7990
*[Abbr]: Abbreviation 1
8091
*[Abbre]: Abbreviation 2
8192
.
@@ -86,7 +97,7 @@ Document[0, 49]
8697
````````````````````````````````
8798

8899

89-
```````````````````````````````` example Abbreviation: 6
100+
```````````````````````````````` example Abbreviation: 7
90101
*[Abbr]: Abbreviation 1
91102
*[Abbre]: Abbreviation 2
92103
@@ -112,7 +123,7 @@ Document[0, 126]
112123
````````````````````````````````
113124

114125

115-
```````````````````````````````` example Abbreviation: 7
126+
```````````````````````````````` example Abbreviation: 8
116127
*[U.S.A.]: United States of America
117128
*[US of A]: United States of America
118129
@@ -132,7 +143,7 @@ Document[0, 136]
132143
````````````````````````````````
133144

134145

135-
```````````````````````````````` example Abbreviation: 8
146+
```````````````````````````````` example Abbreviation: 9
136147
*[US]: United States
137148
*[U.S.A.]: United States of America
138149
*[US of A]: United States of America
@@ -156,7 +167,7 @@ Document[0, 142]
156167
````````````````````````````````
157168

158169

159-
```````````````````````````````` example Abbreviation: 9
170+
```````````````````````````````` example Abbreviation: 10
160171
*[Abbr]: Abbreviation
161172
[Abbr]: http://test.com
162173
@@ -181,7 +192,7 @@ Document[0, 88]
181192

182193
A reference that is not on the first line is just text.
183194

184-
```````````````````````````````` example Abbreviation: 10
195+
```````````````````````````````` example Abbreviation: 11
185196
Paragraph with second line having a reference
186197
*[test]: test abbreviation
187198
@@ -202,7 +213,7 @@ Document[0, 74]
202213

203214
simple use case
204215

205-
```````````````````````````````` example Abbreviation: 11
216+
```````````````````````````````` example Abbreviation: 12
206217
text with abbr embedded
207218
208219
*[abbr]: abbreviation

flexmark-ext-anchorlink/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.vladsch.flexmark</groupId>
66
<artifactId>flexmark-java</artifactId>
7-
<version>0.9.0</version>
7+
<version>0.9.1</version>
88
</parent>
99

1010
<artifactId>flexmark-ext-anchorlink</artifactId>
@@ -28,7 +28,7 @@
2828
<dependency>
2929
<groupId>com.vladsch.flexmark</groupId>
3030
<artifactId>flexmark-jira-converter</artifactId>
31-
<version>0.9.0</version>
31+
<version>0.9.1</version>
3232
<scope>test</scope>
3333
</dependency>
3434
</dependencies>

flexmark-ext-aside/flexmark-ext-aside.iml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
<option name="customNode" value="false" />
1414
<option name="customNodeRepository" value="false" />
1515
</component>
16-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
17-
<output url="file://$MODULE_DIR$/target/classes" />
18-
<output-test url="file://$MODULE_DIR$/target/test-classes" />
16+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
1917
<content url="file://$MODULE_DIR$">
2018
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
2119
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />

flexmark-ext-aside/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.vladsch.flexmark</groupId>
66
<artifactId>flexmark-java</artifactId>
7-
<version>0.9.0</version>
7+
<version>0.9.1</version>
88
</parent>
99

1010
<artifactId>flexmark-ext-aside</artifactId>

0 commit comments

Comments
 (0)