Skip to content

Commit 5d8ccbc

Browse files
committed
add allow namespace to HTML parser.
1 parent 2b0cadf commit 5d8ccbc

File tree

78 files changed

+445
-129
lines changed

Some content is hidden

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

78 files changed

+445
-129
lines changed

.idea/libraries/Maven__junit_junit_4_12.xml

-13
This file was deleted.

.idea/libraries/Maven__junit_junit_4_13.xml

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/com_openhtmltopdf_openhtmltopdf_jsoup_dom_converter.xml

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-navigator.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VERSION.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,16 @@ Please give feedback on the upcoming changes if you have concerns about breaking
181181

182182
* Fix: update OpenHtmlToPDF to 1.0.10
183183
* Fix: update jsoup to 1.14.3
184+
* Fix: update junit to 4.13.2
184185
* Fix: Remove deprecated `of()` sequence methods.
186+
* Fix: [#452, JiraConverter: Mixed lists rendered incorrectly], thanks to
187+
**[znerd](https://github.com/znerd)**
188+
* Fix: merge [#489, add flexmark-ext-resizable-image] thanks to
189+
**[sparksparrow](https://github.com/sparksparrow)**
190+
* Fix: [#482, Namespaces in embedded HTML blocks not supported?]
191+
* Add `Parser.HTML_ALLOW_NAME_SPACE`, default `false` to allow recognizing HTML elements with
192+
namespace prefix. :exclamation: HTML deep parser always allows namespaces and ignores this
193+
option.
185194

186195
## 0.62.4
187196

@@ -214,7 +223,7 @@ Please give feedback on the upcoming changes if you have concerns about breaking
214223

215224
## 0.61.30
216225

217-
* Fix: [#402, When using PegdownOptionsAdapter indented code blocks does not work for lists]
226+
* Fix: [#452, JiraConverter: Mixed lists rendered incorrectly]
218227

219228
## 0.61.28
220229

@@ -339,7 +348,7 @@ Please give feedback on the upcoming changes if you have concerns about breaking
339348
* Deprecate: `JekyllTagExtension.ENABLE_RENDERING`, not used nor needed.
340349
* Fix: [#398, Autolinks get cut off if they contain \`&\` (escaped query params)]
341350

342-
## 0.61.10
351+
## 0.61.10
343352

344353
* Add: `HtmlRenderer.FENCED_CODE_LANGUAGE_DELIMITERS`, default `" \t"`, to configure which chars
345354
terminate the language part of info string
@@ -2154,6 +2163,8 @@ Please give feedback on the upcoming changes if you have concerns about breaking
21542163
[#397, PR: Add base64 image support with docx rendering]: https://github.com/vsch/flexmark-java/pull/397
21552164
[#398, Autolinks get cut off if they contain \`&\` (escaped query params)]: https://github.com/vsch/flexmark-java/issues/398
21562165
[#407, Link text inline content fails to parse image references]: https://github.com/vsch/flexmark-java/issues/407
2166+
[#452, JiraConverter: Mixed lists rendered incorrectly]: https://github.com/vsch/flexmark-java/issues/452
2167+
[#489, add flexmark-ext-resizable-image]: https://github.com/vsch/flexmark-java/issues/489
21572168
[@Xaelis]: https://github.com/Xaelis
21582169
[Awesome Console]: https://plugins.jetbrains.com/plugin/7677-awesome-console "Awesome Console"
21592170
[HtmlToMarkdownCustomizedSample.java]: https://github.com/vsch/flexmark-java/blob/master/flexmark-java-samples/src/com/vladsch/flexmark/java/samples/HtmlToMarkdownCustomizedSample.java
@@ -2164,6 +2175,6 @@ Please give feedback on the upcoming changes if you have concerns about breaking
21642175
[migrate 0_35_x to 0_40_0.xml]: /assets/migrations/migrate%20flexmark-java%200_35_x%20to%200_40_0.xml
21652176
[migrate flexmark-java 0_40_x to 0_42_0]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_40_x%20to%200_42_0.xml
21662177
[migrate flexmark-java 0_42_x to 0_50_0.xml]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml
2178+
[#482, Namespaces in embedded HTML blocks not supported?]: https://github.com/vsch/flexmark-java/issues/482
21672179
21682180
2169-
[#402, When using PegdownOptionsAdapter indented code blocks does not work for lists]: https://github.com/vsch/flexmark-java/issues/402

flexmark-core-test/flexmark-core-test.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
<orderEntry type="library" name="apache.logging.log4j.core" level="project" />
4949
<orderEntry type="library" name="Maven: net.sf.jopt-simple:jopt-simple:4.6" level="project" />
5050
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.2" level="project" />
51-
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
51+
<orderEntry type="library" name="Maven: junit:junit:4.13" level="project" />
5252
</component>
5353
</module>

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

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import static org.hamcrest.CoreMatchers.instanceOf;
3232
import static org.hamcrest.CoreMatchers.notNullValue;
33+
import static org.hamcrest.MatcherAssert.assertThat;
3334
import static org.junit.Assert.*;
3435

3536
final public class ParserTest {

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/renderer/CoreRendererSpecTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public abstract class CoreRendererSpecTest extends RendererSpecTest {
9898
optionsMap.put("block-quote-extend", new MutableDataSet().set(Parser.BLOCK_QUOTE_EXTEND_TO_BLANK_LINE, true));
9999
optionsMap.put("block-ignore-blank", new MutableDataSet().set(Parser.BLOCK_QUOTE_IGNORE_BLANK_LINE, true));
100100
optionsMap.put("html-block-start-only-on-block-tags", new MutableDataSet().set(Parser.HTML_BLOCK_START_ONLY_ON_BLOCK_TAGS, true));
101+
optionsMap.put("no-html-block-start-only-on-block-tags", new MutableDataSet().set(Parser.HTML_BLOCK_START_ONLY_ON_BLOCK_TAGS, false));
101102
optionsMap.put("setext-marker-length", new MutableDataSet().set(Parser.HEADING_SETEXT_MARKER_LENGTH, 3));
102103
optionsMap.put("src-pos-lines", new MutableDataSet().set(HtmlRenderer.SOURCE_POSITION_PARAGRAPH_LINES, true).set(Parser.CODE_SOFT_LINE_BREAKS, true));
103104
optionsMap.put("src-pos-lines-splice", new MutableDataSet().set(HtmlRenderer.SOURCE_POSITION_PARAGRAPH_LINES, true).set(Parser.CODE_SOFT_LINE_BREAKS, true).set(HtmlRenderer.INLINE_CODE_SPLICE_CLASS, "line-spliced"));
@@ -121,6 +122,7 @@ public abstract class CoreRendererSpecTest extends RendererSpecTest {
121122
optionsMap.put("spec-027", new MutableDataSet().set(Parser.STRONG_WRAPS_EMPHASIS, true));
122123
optionsMap.put("custom-list-marker", new MutableDataSet().set(Parser.LISTS_ITEM_PREFIX_CHARS, "*/"));
123124
optionsMap.put("no-p-tags", new MutableDataSet().set(HtmlRenderer.NO_P_TAGS_USE_BR, true));
125+
optionsMap.put("allow-name-space", new MutableDataSet().set(Parser.HTML_ALLOW_NAME_SPACE, true));
124126
optionsMap.put("list-markdown-navigator", new MutableDataSet()
125127
.set(Parser.LISTS_AUTO_LOOSE, false)
126128
.set(Parser.LISTS_AUTO_LOOSE, false)

flexmark-core-test/src/test/resources/core_extra_ast_spec2.md

+151
Original file line numberDiff line numberDiff line change
@@ -634,3 +634,154 @@ Document[0, 114]
634634
````````````````````````````````
635635

636636

637+
## HTML Allow Name Space
638+
639+
```````````````````````````````` example(HTML Allow Name Space: 1) options(allow-name-space)
640+
<ns:elem>
641+
</ns:elem>
642+
643+
.
644+
<ns:elem>
645+
</ns:elem>
646+
.
647+
Document[0, 22]
648+
HtmlBlock[0, 21]
649+
````````````````````````````````
650+
651+
652+
```````````````````````````````` example(HTML Allow Name Space: 2) options(deep-html-parsing, allow-name-space)
653+
<ns:strong>
654+
</ns:strong>
655+
656+
.
657+
<p><a href="ns:strong">ns:strong</a>
658+
&lt;/ns:strong&gt;</p>
659+
.
660+
Document[0, 26]
661+
Paragraph[0, 25] isTrailingBlankLine
662+
AutoLink[0, 11] open:[0, 1, "<"] text:[1, 10, "ns:strong"] pageRef:[1, 10, "ns:strong"] close:[10, 11, ">"]
663+
SoftLineBreak[11, 12]
664+
Text[12, 24] chars:[12, 24, "</ns: … rong>"]
665+
````````````````````````````````
666+
667+
668+
```````````````````````````````` example(HTML Allow Name Space: 3) options(deep-html-parsing, allow-name-space, no-html-block-start-only-on-block-tags)
669+
<ns:strong>
670+
</ns:strong>
671+
672+
.
673+
<ns:strong>
674+
</ns:strong>
675+
.
676+
Document[0, 26]
677+
HtmlBlock[0, 25]
678+
````````````````````````````````
679+
680+
681+
```````````````````````````````` example(HTML Allow Name Space: 4) options(deep-html-parsing)
682+
<ns:table>
683+
</ns:table>
684+
685+
.
686+
<ns:table>
687+
</ns:table>
688+
.
689+
Document[0, 24]
690+
HtmlBlock[0, 23]
691+
````````````````````````````````
692+
693+
694+
```````````````````````````````` example(HTML Allow Name Space: 5) options(deep-html-parsing, allow-name-space)
695+
<ns:table>
696+
</ns:table>
697+
698+
.
699+
<ns:table>
700+
</ns:table>
701+
.
702+
Document[0, 24]
703+
HtmlBlock[0, 23]
704+
````````````````````````````````
705+
706+
707+
```````````````````````````````` example(HTML Allow Name Space: 6) options(deep-html-parsing, allow-name-space, no-html-block-start-only-on-block-tags)
708+
<ns:table>
709+
</ns:table>
710+
711+
.
712+
<ns:table>
713+
</ns:table>
714+
.
715+
Document[0, 24]
716+
HtmlBlock[0, 23]
717+
````````````````````````````````
718+
719+
720+
```````````````````````````````` example(HTML Allow Name Space: 7) options(allow-name-space)
721+
<ns:table>
722+
</ns:table>
723+
724+
.
725+
<ns:table>
726+
</ns:table>
727+
.
728+
Document[0, 24]
729+
HtmlBlock[0, 23]
730+
````````````````````````````````
731+
732+
733+
```````````````````````````````` example(HTML Allow Name Space: 8) options(allow-name-space)
734+
<ns:table>
735+
</ns:table>
736+
737+
.
738+
<ns:table>
739+
</ns:table>
740+
.
741+
Document[0, 24]
742+
HtmlBlock[0, 23]
743+
````````````````````````````````
744+
745+
746+
```````````````````````````````` example(HTML Allow Name Space: 9) options(allow-name-space, html-block-start-only-on-block-tags)
747+
<ns:table>
748+
</ns:table>
749+
750+
.
751+
<ns:table>
752+
</ns:table>
753+
.
754+
Document[0, 24]
755+
HtmlBlock[0, 23]
756+
````````````````````````````````
757+
758+
759+
```````````````````````````````` example(HTML Allow Name Space: 10) options(allow-name-space, html-block-start-only-on-block-tags)
760+
<ns:strong>
761+
</ns:strong>
762+
763+
.
764+
<p><a href="ns:strong">ns:strong</a>
765+
&lt;/ns:strong&gt;</p>
766+
.
767+
Document[0, 26]
768+
Paragraph[0, 25] isTrailingBlankLine
769+
AutoLink[0, 11] open:[0, 1, "<"] text:[1, 10, "ns:strong"] pageRef:[1, 10, "ns:strong"] close:[10, 11, ">"]
770+
SoftLineBreak[11, 12]
771+
Text[12, 24] chars:[12, 24, "</ns: … rong>"]
772+
````````````````````````````````
773+
774+
775+
```````````````````````````````` example(HTML Allow Name Space: 11) options(allow-name-space, no-html-block-start-only-on-block-tags)
776+
<ns:strong>
777+
</ns:strong>
778+
779+
.
780+
<ns:strong>
781+
</ns:strong>
782+
.
783+
Document[0, 26]
784+
HtmlBlock[0, 25]
785+
````````````````````````````````
786+
787+

flexmark-docx-converter/flexmark-docx-converter.iml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<orderEntry type="module" module-name="flexmark-ext-toc" />
5252
<orderEntry type="module" module-name="flexmark-ext-wikilink" />
5353
<orderEntry type="module" module-name="flexmark-ext-autolink" scope="TEST" />
54-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
54+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
5555
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
5656
<orderEntry type="module" module-name="flexmark-ext-gitlab" />
5757
<orderEntry type="module" module-name="flexmark-ext-macros" />
@@ -61,4 +61,4 @@
6161
<orderEntry type="library" name="slf4j.log4j.over" level="project" />
6262
<orderEntry type="library" name="slf4j-api-1.7.26" level="project" />
6363
</component>
64-
</module>
64+
</module>

flexmark-ext-abbreviation/flexmark-ext-abbreviation.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<orderEntry type="module" module-name="flexmark-util-misc" />
2424
<orderEntry type="module" module-name="flexmark-util-sequence" />
2525
<orderEntry type="module" module-name="flexmark-util-visitor" />
26-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
26+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
2727
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
2828
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
2929
<orderEntry type="module" module-name="flexmark-ext-typographic" scope="TEST" />

flexmark-ext-admonition/flexmark-ext-admonition.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<orderEntry type="module" module-name="flexmark-util-misc" />
3636
<orderEntry type="module" module-name="flexmark-util-sequence" />
3737
<orderEntry type="module" module-name="flexmark-util-visitor" />
38-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
38+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
3939
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
4040
<orderEntry type="module" module-name="flexmark-test-util" scope="TEST" />
4141
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />

flexmark-ext-anchorlink/flexmark-ext-anchorlink.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<orderEntry type="module" module-name="flexmark-util-misc" />
2222
<orderEntry type="module" module-name="flexmark-util-sequence" />
2323
<orderEntry type="module" module-name="flexmark-util-visitor" />
24-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
24+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
2525
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
2626
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
2727
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<orderEntry type="module" module-name="flexmark" />
3535
<orderEntry type="module" module-name="flexmark-test-util" scope="TEST" />
3636
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
37-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
37+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
3838
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
3939
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
4040
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />

flexmark-ext-attributes/flexmark-ext-attributes.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<orderEntry type="module" module-name="flexmark-ext-anchorlink" scope="TEST" />
4141
<orderEntry type="module" module-name="flexmark-ext-toc" scope="TEST" />
4242
<orderEntry type="module" module-name="flexmark-ext-emoji" scope="TEST" />
43-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
43+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
4444
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
4545
<orderEntry type="module" module-name="flexmark-ext-definition" scope="TEST" />
4646
<orderEntry type="module" module-name="flexmark-ext-tables" scope="TEST" />

flexmark-ext-autolink/flexmark-ext-autolink.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<orderEntry type="module" module-name="flexmark-util-sequence" />
2323
<orderEntry type="module" module-name="flexmark-util-visitor" />
2424
<orderEntry type="library" name="Maven: org.nibor.autolink:autolink:0.6.0" level="project" />
25-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
25+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
2626
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
2727
<orderEntry type="module" module-name="flexmark-ext-typographic" scope="TEST" />
2828
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />

flexmark-ext-definition/flexmark-ext-definition.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<orderEntry type="module" module-name="flexmark" />
3636
<orderEntry type="module" module-name="flexmark-test-util" scope="TEST" />
3737
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
38-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
38+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
3939
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
4040
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
4141
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />

flexmark-ext-emoji/flexmark-ext-emoji.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<orderEntry type="module" module-name="flexmark-util-sequence" />
2525
<orderEntry type="module" module-name="flexmark-util-visitor" />
2626
<orderEntry type="module" module-name="flexmark-jira-converter" />
27-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
27+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
2828
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
2929
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
3030
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />

flexmark-ext-enumerated-reference/flexmark-ext-enumerated-reference.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<orderEntry type="module" module-name="flexmark-ext-attributes" />
4040
<orderEntry type="module" module-name="flexmark-ext-tables" scope="TEST" />
4141
<orderEntry type="module" module-name="flexmark-core-test" scope="TEST" />
42-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
42+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
4343
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
4444
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />
4545
</component>

0 commit comments

Comments
 (0)