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

Correctly parse paragraphs with trailing spaces #347

Merged
merged 13 commits into from
Sep 9, 2023

Conversation

Witiko
Copy link
Owner

@Witiko Witiko commented Sep 5, 2023

Closes #345 and continues https://github.com/danopolan/istqb_latex/pull/77.

Tasks

Nice to haves

  • Find all CommonMark examples that test the behavior of trailing tabs and spaces and add them as testfiles that only run with the ConTeXt MkIV format or with the verbatim template.
  • Add and document optional fields title, author, and date to YAML blocks. Display these fields in addition to the name of a testfile in test.py.

@Witiko Witiko added bug lua Related to the Lua interface and implementation labels Sep 5, 2023
@Witiko Witiko added this to the 3.1.0 milestone Sep 5, 2023
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch 2 times, most recently from 88072da to 67cd215 Compare September 6, 2023 11:50
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch from 67cd215 to 418c94b Compare September 6, 2023 11:58
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch 3 times, most recently from f4e57df to 8669d04 Compare September 8, 2023 08:22
@Witiko
Copy link
Owner Author

Witiko commented Sep 8, 2023

  • Find all CommonMark examples that test the behavior of trailing tabs and spaces [...]

I created a python file get_examples_with_trailing_tabs_and_spaces.py with the following content:

import json
import sys

for example in json.load(sys.stdin):
    if ' \n' in example['markdown'] or '\t\n' in example['markdown'] or example['markdown'].endswith(' ') or example['markdown'].endswith('\t'):
        print(example['example'])

Then, I ran the following commands, finding 34 CommonMark examples with trailing tabs and spaces:

$ curl -s 'https://spec.commonmark.org/0.30/spec.json' | python3 get_examples_with_trailing_tabs_and_spaces.py
11
54
67
73
79
82
86
89
111
112
117
118
129
193
226
227
240
241
279
282
335
336
337
555
586
633
635
636
638
640
642
645
647
649

$ curl -s 'https://spec.commonmark.org/0.30/spec.json' | python3 get_examples_with_trailing_tabs_and_spaces.py | wc -l
34

@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch 4 times, most recently from 9399818 to 32c3326 Compare September 8, 2023 10:31
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch from 32c3326 to b8538d3 Compare September 8, 2023 11:02
@Witiko Witiko added automerge This pull request will be automatically merged after continuous integration has succeeded and removed automerge This pull request will be automatically merged after continuous integration has succeeded labels Sep 8, 2023
@Witiko Witiko marked this pull request as ready for review September 8, 2023 17:09
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch from 52ccf8b to b14167f Compare September 8, 2023 17:10
@Witiko Witiko force-pushed the fix/paragraphs-with-trailing-spaces branch from b14167f to e0d76e3 Compare September 8, 2023 22:21
@Witiko Witiko merged commit d4c8e22 into main Sep 9, 2023
@Witiko Witiko deleted the fix/paragraphs-with-trailing-spaces branch September 9, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge This pull request will be automatically merged after continuous integration has succeeded bug lua Related to the Lua interface and implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The parser does not parse the full ISTQB example document
1 participant