forked from jgm/lunamark
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support deferred content (footnotes, links, and images) with slicing
Content that is produced lazily using deferred resolution of references needs to use the state of the writer at the time of resolution attempt, not at the time of the actual resolution.
- Loading branch information
Showing
2 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/testfiles/lunamark-markdown/slice-with-deferred-content.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
\def\markdownOptionFootnotes{true} | ||
\def\markdownOptionHeaderAttributes{true} | ||
\def\markdownOptionSlice{section-with-deferred-content} | ||
<<< | ||
# This is a section | ||
# This is another section {#section-with-deferred-content} | ||
Here is a [^footnote], a [link][], and an ![image][]. | ||
|
||
# This is yet another section | ||
Here are the definitions: | ||
|
||
[^footnote]: This is the text of the footnote. | ||
|
||
[link]: http://link (This is the title of the link.) | ||
|
||
[image]: http://image (This is the title of the image.) | ||
>>> | ||
headingOne: This is another section | ||
interblockSeparator | ||
footnote: This is the text of the footnote. | ||
BEGIN link | ||
- label: link | ||
- URI: http://link | ||
- title: This is the title of the link. | ||
END link | ||
BEGIN image | ||
- label: image | ||
- URI: http://image | ||
- title: This is the title of the image. | ||
END image | ||
interblockSeparator |