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

Restore CommonMark testfiles with trailing tabs and spaces #348

Closed
Witiko opened this issue Sep 9, 2023 · 0 comments · Fixed by #353
Closed

Restore CommonMark testfiles with trailing tabs and spaces #348

Witiko opened this issue Sep 9, 2023 · 0 comments · Fixed by #353
Labels
tests Related to the unit testng framework
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Sep 9, 2023

In lostenderman#2, @lostenderman added testfiles for the CommonMark 0.30 standard. However, trailing tabs and spaces are not preserved in verbatim environments such as \begin{markdown} ... \end{markdown} with the exception of the ConTeXt MkIV format. Therefore, testfiles with trailing tabs and spaces were either removed or altered before and during #226.

Since #347, testfiles can now contain YAML metadata that specify which TeX formats and templates are supported by the testfile. For example, a testfile that supports the ConTeXt MkIV format and the input template of other formats might have the following header:

if: format == 'context-mkiv' or template == 'input'
---

This allows us to restore CommonMark testfiles with trailing tabs and spaces to the state from lostenderman#2.

A list of CommonMark examples with trailing tabs and spaces is given in #347 (comment). The ConTeXt support for trailing tabs and spaces consists of replacing any two tabs/spaces at the end of a line with two tabs, which, unlike spaces, are guaranteed to be preserved by TeX:

line = line:gsub("[ \t][ \t]$", "\t\t")

While this is sufficient for content inside of paragraphs, where hard line breaks will always be correctly recognized in ConTeXt, extra training tabs will be produced in (fenced) code blocks. Therefore, testfiles that only require the preservation of trailing tabs and spaces in paragraphs should contain the following condition: format == 'context-mkiv' or template == 'input'. Testfiles that require the preservation of trailing tabs and spaces in (fenced) code blocks should contain the following condition: template == 'input'.

@Witiko Witiko added the tests Related to the unit testng framework label Sep 9, 2023
@Witiko Witiko added this to the 3.2.0 milestone Sep 9, 2023
@Witiko Witiko added the bug label Oct 9, 2023
@Witiko Witiko removed the bug label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Related to the unit testng framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant