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

fix: parsing code blocks & custom separators #1081

Merged
merged 5 commits into from
Sep 22, 2024
Merged

fix: parsing code blocks & custom separators #1081

merged 5 commits into from
Sep 22, 2024

Conversation

st3v3nmw
Copy link
Owner

@st3v3nmw st3v3nmw commented Sep 21, 2024

This PR:

  1. Renames close in the grammar to cloze
  2. Adds test cases for parsing {{curly}} clozes
  3. Fixes [Bug]: Detecting inside codeblocks since last update #1072
    • Ignores 'cards' in ```block`` & inline codeblocks
    • Adds test cases for both
  4. Fixes [Bug]: plugin does not detect tags/cards after recent update #1077
    • When all the cloze options aren't being used, cloze_rules in parser.ts becomes empty which leads to the empty grammar rule cloze_text which prevents the parser from being generated. This change puts a tombstone \0 instead to address this.
    • Adds test cases for this

This PR:
1. Adds test cases for parsing {{curly}} clozes
2. Fixes #1072
    - Ignore 'cards' in ```block`` & `inline` codeblocks
    - Adds test cases for both
3. Fixes #1077
    - When all the cloze options aren't being used, `cloze_rules` in
     `parser.ts` becomes empty which leads to the empty grammar rule `cloze_text`
     which prevents the grammar from being generated. This change adds a
     tombstone \0 to address this.
    - Adds test cases for this
@st3v3nmw st3v3nmw force-pushed the fix-parser branch 2 times, most recently from 3a74ec9 to 2d70203 Compare September 21, 2024 17:32
…perly hanlded by clozes

- Fixed a new issue related to the case when the user provides empty markers for the inline and multiline cards. With the new version, the rule is disabled when the marker is empty.
@st3v3nmw st3v3nmw merged commit 657e37d into master Sep 22, 2024
1 check passed
@st3v3nmw st3v3nmw deleted the fix-parser branch September 22, 2024 10:14
Newdea pushed a commit to open-spaced-repetition/obsidian-spaced-repetition-recall that referenced this pull request Sep 25, 2024
* fix: parsing code blocks & custom separators

This PR:
1. Adds test cases for parsing {{curly}} clozes
2. Fixes st3v3nmw#1072
    - Ignore 'cards' in ```block`` & `inline` codeblocks
    - Adds test cases for both
3. Fixes st3v3nmw#1077
    - When all the cloze options aren't being used, `cloze_rules` in
     `parser.ts` becomes empty which leads to the empty grammar rule `cloze_text`
     which prevents the grammar from being generated. This change adds a
     tombstone \0 to address this.
    - Adds test cases for this

* Fixed inline code in clozes

* - Fixed issue raised at st3v3nmw#1072 (comment) where inline code was not properly hanlded by clozes
- Fixed a new issue related to the case when the user provides empty markers for the inline and multiline cards. With the new version, the rule is disabled when the marker is empty.

* add parser test case

* add more parser test cases

---------

Co-authored-by: Andrea Alberti <a.alberti82@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants