Skip to content

Commit

Permalink
fix for #407
Browse files Browse the repository at this point in the history
  • Loading branch information
vsch committed Apr 29, 2020
1 parent b474894 commit 1f2618e
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
8 changes: 8 additions & 0 deletions VERSION-TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Release 0.60.0](#release-0600)
- [API Refactoring](#api-refactoring)
- [Next 0.61.xx](#next-061xx)
- [0.61.22](#06122)
- [0.61.20](#06120)
- [0.61.18](#06118)
- [0.61.16](#06116)
Expand Down Expand Up @@ -222,6 +223,11 @@ Please give feedback on the upcoming changes if you have concerns about breaking
* [ ] Fix: Html converter to not add spaces between end of inline marker and next punctuation:
`.,:;`

## 0.61.22

* Fix: [#407, Link text inline content fails to parse image references], link and image refs in
link text would be collapsed even when they are not tentative but defined.

## 0.61.20

* Fix: `JekyllTagExtension` handling of inline include tag. If included file contains a single
Expand Down Expand Up @@ -2452,4 +2458,6 @@ Please give feedback on the upcoming changes if you have concerns about breaking
[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
<!-- @IGNORE PREVIOUS: link -->
[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
[#407, Link text inline content fails to parse image references]: https://github.com/vsch/flexmark-java/issues/407
8 changes: 8 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [Release 0.60.0](#release-0600)
- [API Refactoring](#api-refactoring)
- [0.61.22](#06122)
- [0.61.20](#06120)
- [0.61.18](#06118)
- [0.61.16](#06116)
Expand Down Expand Up @@ -166,6 +167,11 @@ Please give feedback on the upcoming changes if you have concerns about breaking
* `com.vladsch.flexmark.util.ast.NodeAdaptingVisitHandler`
* `com.vladsch.flexmark.util.ast.NodeAdaptingVisitor`

## 0.61.22

* Fix: [#407, Link text inline content fails to parse image references], link and image refs in
link text would be collapsed even when they are not tentative but defined.

## 0.61.20

* Fix: `JekyllTagExtension` handling of inline include tag. If included file contains a single
Expand Down Expand Up @@ -2045,3 +2051,5 @@ Please give feedback on the upcoming changes if you have concerns about breaking
[#398, Autolinks get cut off if they contain \`&amp;\` (escaped query params)]: https://github.com/vsch/flexmark-java/issues/398
[#407, Link text inline content fails to parse image references]: https://github.com/vsch/flexmark-java/issues/407
70 changes: 69 additions & 1 deletion flexmark-core-test/src/test/resources/core_issues_ast_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ Issue #384,

<a href="https://doc-kurento.readthedocs.io/en/stable/user/installation.html">Install Kurento Media server</a>
<div class="bd-callout bd-callout-danger">
It should be run under same user as OM
It should be run under same user as OM
</div>

## Specify/Install Turn server
Expand Down Expand Up @@ -1323,6 +1323,74 @@ Document[0, 474]
````````````````````````````````


### 407

Issue #487

Wrong syntax

```````````````````````````````` example Core Issues Tests - 407: 1
[![][moon]](/uri)

[moon]: moon.jpg
.
<p><a href="/uri"><img src="moon.jpg" alt="" /></a></p>
.
Document[0, 35]
Paragraph[0, 18] isTrailingBlankLine
Link[0, 17] textOpen:[0, 1, "["] text:[1, 10, "![][moon]"] textClose:[10, 11, "]"] linkOpen:[11, 12, "("] url:[12, 16, "/uri"] pageRef:[12, 16, "/uri"] linkClose:[16, 17, ")"]
ImageRef[1, 10] textOpen:[1, 3, "!["] text:[3, 3] textClose:[3, 4, "]"] referenceOpen:[4, 5, "["] reference:[5, 9, "moon"] referenceClose:[9, 10, "]"]
Reference[19, 35] refOpen:[19, 20, "["] ref:[20, 24, "moon"] refClose:[24, 26, "]:"] url:[27, 35, "moon.jpg"]
````````````````````````````````


```````````````````````````````` example Core Issues Tests - 407: 2
[![moon]](/uri)

[moon]: moon.jpg
.
<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
.
Document[0, 33]
Paragraph[0, 16] isTrailingBlankLine
Link[0, 15] textOpen:[0, 1, "["] text:[1, 8, "![moon]"] textClose:[8, 9, "]"] linkOpen:[9, 10, "("] url:[10, 14, "/uri"] pageRef:[10, 14, "/uri"] linkClose:[14, 15, ")"]
ImageRef[1, 8] referenceOpen:[1, 3, "!["] reference:[3, 7, "moon"] referenceClose:[7, 8, "]"]
Text[3, 7] chars:[3, 7, "moon"]
Reference[17, 33] refOpen:[17, 18, "["] ref:[18, 22, "moon"] refClose:[22, 24, "]:"] url:[25, 33, "moon.jpg"]
````````````````````````````````


```````````````````````````````` example Core Issues Tests - 407: 3
[![moon][]](/uri)

[moon]: moon.jpg
.
<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
.
Document[0, 35]
Paragraph[0, 18] isTrailingBlankLine
Link[0, 17] textOpen:[0, 1, "["] text:[1, 10, "![moon][]"] textClose:[10, 11, "]"] linkOpen:[11, 12, "("] url:[12, 16, "/uri"] pageRef:[12, 16, "/uri"] linkClose:[16, 17, ")"]
ImageRef[1, 10] referenceOpen:[1, 3, "!["] reference:[3, 7, "moon"] referenceClose:[7, 8, "]"] textOpen:[8, 9, "["] textClose:[9, 10, "]"]
Text[3, 7] chars:[3, 7, "moon"]
Reference[19, 35] refOpen:[19, 20, "["] ref:[20, 24, "moon"] refClose:[24, 26, "]:"] url:[27, 35, "moon.jpg"]
````````````````````````````````


```````````````````````````````` example Core Issues Tests - 407: 4
![moon]

[moon]: moon.jpg
.
<p><img src="moon.jpg" alt="moon" /></p>
.
Document[0, 25]
Paragraph[0, 8] isTrailingBlankLine
ImageRef[0, 7] referenceOpen:[0, 2, "!["] reference:[2, 6, "moon"] referenceClose:[6, 7, "]"]
Text[2, 6] chars:[2, 6, "moon"]
Reference[9, 25] refOpen:[9, 10, "["] ref:[10, 14, "moon"] refClose:[14, 16, "]:"] url:[17, 25, "moon.jpg"]
````````````````````````````````


## Issues xxx

### 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ protected boolean parseCloseBracket() {

// collapse any link refs contained in this link, they are duds, link takes precedence
// TODO: add a test to see if all link refs should be collapsed or just undefined ones
collapseLinkRefChildren(insertNode, null, true);
collapseLinkRefChildren(insertNode, true, true);
} else if (insertNode instanceof RefNode) {
// have a link ref, collapse to text any tentative ones contained in it, they are duds
collapseLinkRefChildren(insertNode, true, true);
Expand Down

0 comments on commit 1f2618e

Please sign in to comment.