Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for the contentType Lua option #375

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions tests/testfiles/lunamark-markdown/content-type-block.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
\markdownSetup{contentType=block}
<<<
This test ensures that the Lua `contentType` option correctly propagates
through the plain TeX interface. Setting the `contentType` option to the
default value `block` should have no effect.

Here are some inline elements:

- *emphasis* and __strong emphasis__
- [link](https://example/url "Example title")
- ![image](https://example/url "Example title")
- `code`

Here are some block elements:

- > blockquote
- code

block
-
* bullet
* list
-
1. ordered
2. list
>>>
BEGIN document
codeSpan: contentType
someLineBreak
codeSpan: contentType
someLineBreak
codeSpan: block
paragraphSeparator
interblockSeparator
ulBeginTight
ulItem
emphasis: emphasis
strongEmphasis: strong emphasis
ulItemEnd
ulItem
BEGIN link
- label: link
- URI: https://example/url
- title: Example title
END link
ulItemEnd
ulItem
BEGIN image
- label: image
- URI: https://example/url
- title: Example title
END image
ulItemEnd
ulItem
codeSpan: code
ulItemEnd
ulEndTight
interblockSeparator
interblockSeparator
ulBegin
ulItem
blockQuoteBegin
blockQuoteEnd
ulItemEnd
ulItem
interblockSeparator
inputVerbatim: ./_markdown_test/14511f2f5564650d129ca7cabc333278.verbatim
ulItemEnd
ulItem
ulBeginTight
ulItem
ulItemEnd
ulItem
ulItemEnd
ulEndTight
ulItemEnd
ulItem
olBeginTight
olItemWithNumber: 1
olItemEnd
olItemWithNumber: 2
olItemEnd
olEndTight
ulItemEnd
ulEnd
END document
47 changes: 47 additions & 0 deletions tests/testfiles/lunamark-markdown/content-type-inline.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
\markdownSetup{contentType=inline}
<<<
This test ensures that the Lua `contentType` option correctly propagates
through the plain TeX interface. Setting the `contentType` option to the
`inline` value should disable the part of the markdown grammar that deals
with block elements. Instead of separating blocks and paragraphs, blank
lines should translate to spaces, lists and blockquotes should just be
understood as plain text.

Here are some inline elements:

- *emphasis* and __strong emphasis__
- [link](https://example/url "Example title")
- ![image](https://example/url "Example title")
- `code`

Here are some block elements:

- > blockquote
- code

block
-
* bullet
* list
-
1. ordered
2. list
>>>
BEGIN document
codeSpan: contentType
codeSpan: contentType
codeSpan: inline
emphasis: emphasis
strongEmphasis: strong emphasis
BEGIN link
- label: link
- URI: https://example/url
- title: Example title
END link
BEGIN image
- label: image
- URI: https://example/url
- title: Example title
END image
codeSpan: code
END document
Loading