Skip to content

Commit 96891d2

Browse files
committed
[test]add tests for stackoverflow
1 parent bcfe84a commit 96891d2

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ target/
3838
/assets/comms/
3939
/lib/
4040
/mvn-dependency-tree.txt
41+
42+
# local
43+
.vscode/
44+
.DS_Store
45+
.devcontainer/
46+
.claude/

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/SpecialInputTest.java

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
package com.vladsch.flexmark.core.test.util.parser;
22

3+
import org.jetbrains.annotations.NotNull;
4+
import org.jetbrains.annotations.Nullable;
5+
import org.junit.Test;
6+
37
import com.vladsch.flexmark.html.HtmlRenderer;
48
import com.vladsch.flexmark.parser.Parser;
5-
import com.vladsch.flexmark.test.util.*;
9+
import com.vladsch.flexmark.test.util.FlexmarkSpecExampleRenderer;
10+
import com.vladsch.flexmark.test.util.RenderingTestCase;
11+
import com.vladsch.flexmark.test.util.SpecExampleRenderer;
12+
import com.vladsch.flexmark.test.util.Strings;
13+
import com.vladsch.flexmark.test.util.TestUtils;
614
import com.vladsch.flexmark.test.util.spec.SpecExample;
715
import com.vladsch.flexmark.util.data.DataHolder;
816
import com.vladsch.flexmark.util.data.DataSet;
917
import com.vladsch.flexmark.util.data.MutableDataSet;
10-
import org.jetbrains.annotations.NotNull;
11-
import org.jetbrains.annotations.Nullable;
12-
import org.junit.Test;
1318

1419
final public class SpecialInputTest extends RenderingTestCase {
1520
final private static DataHolder OPTIONS = new MutableDataSet()
@@ -121,7 +126,19 @@ public void linkLabelLength() {
121126

122127
@Test
123128
public void manyUnderscores() {
124-
assertRendering(Strings.repeat("_", 1000), "<hr />");
129+
assertRendering(Strings.repeat("_", 100000), "<hr />");
130+
}
131+
132+
@Test
133+
public void uncompletedHugeHtmlTag() {
134+
assertRendering("<" + Strings.repeat("a", 1000000), "&lt;" + Strings.repeat("a", 1000000));
135+
}
136+
137+
@Test
138+
public void hugeDataUrlInLink() {
139+
String url = "https://example.com/" + "A".repeat(5000);
140+
String markdown = "[link]: <" + url + ">";
141+
assertRendering(markdown, "<a href=\"" + url + "\">link</a>");
125142
}
126143

127144
@Nullable

0 commit comments

Comments
 (0)