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

[Bug]: plugin does not detect tags/cards after recent update #1077

Closed
adakka opened this issue Sep 18, 2024 · 14 comments · Fixed by #1081
Closed

[Bug]: plugin does not detect tags/cards after recent update #1077

adakka opened this issue Sep 18, 2024 · 14 comments · Fixed by #1081
Labels
bug Something isn't working

Comments

@adakka
Copy link

adakka commented Sep 18, 2024

Describe the bug

plugin does not detect tags/cards after recent update

To Reproduce

  1. Updated plugin
  2. No cards can be displayed

Expected behavior

cards displayed normally

Screenshots

No response

OS of your device

Windows 11 & iOS

Obsidian version

1.7.1

Plugin version

1.12.6

Installer version

1.4.13

Additional context

No response

Config file

No response

@adakka adakka added the bug Something isn't working label Sep 18, 2024
@yett1873
Copy link

yett1873 commented Sep 18, 2024

I'm having a similar issue: the plugin stops recognizing new multiline cards but still recognizes cards with clozes.
My Obsidian is on 1.7.1. The issue resolves once I roll back to 1.12.5.

@ronzulu
Copy link
Collaborator

ronzulu commented Sep 19, 2024

Hi there

I haven't been able to reproduce the problem, could you please send through (as an attachment, not copy/paste)

  1. Your configuration file, for example on my machine this is located at:
    D:\Obsidian\.obsidian\plugins\obsidian-spaced-repetition\data.json

  2. A sample markdown file that includes cards that are no longer detected.

Also, with 1.12.6 running:
3. A screenshot of the deck selection dialog, e.g.:
image

Cheers
Ronny

@adakka
Copy link
Author

adakka commented Sep 19, 2024 via email

@ronzulu
Copy link
Collaborator

ronzulu commented Sep 19, 2024

Thanks for that, unfortunately GitHub only extracted the text from your email to include in the post. Any attachments that you had in it were ignored.

I think you'll need to use the GitHub website and create a post, and attach the files there manually.

@adakka
Copy link
Author

adakka commented Sep 20, 2024

image
data.json
fc immuno.md

@adakka
Copy link
Author

adakka commented Sep 20, 2024

The previous version works without any problems

@Smitty010
Copy link

Here's an error I'm seeing a lot of
plugin:obsidian-spaced-repetition:9740 Unexpected error: SyntaxError: Expected ":", comment, end of line, or whitespace but "=" found. (at plugin:obsidian-spaced-repetition:5023:23)
at new peg$SyntaxError (plugin:obsidian-spaced-repetition:5023:23)
at eval (plugin:obsidian-spaced-repetition:5553:18)
at Object.peg$parse [as parse] (plugin:obsidian-spaced-repetition:5554:10)
at eval (plugin:obsidian-spaced-repetition:6259:27)
at Array.map ()
at generate (plugin:obsidian-spaced-repetition:6257:32)
at generateParser (plugin:obsidian-spaced-repetition:9450:43)
at parseEx (plugin:obsidian-spaced-repetition:9732:21)
at NoteQuestionParser.parseQuestions (plugin:obsidian-spaced-repetition:11753:20)
at NoteQuestionParser.doCreateQuestionList (plugin:obsidian-spaced-repetition:11719:41)
at NoteQuestionParser.createQuestionList (plugin:obsidian-spaced-repetition:11695:32)
at async NoteFileLoader.load (plugin:obsidian-spaced-repetition:11923:26)
at async OsrAppCore.loadNote (plugin:obsidian-spaced-repetition:12900:18)
at async OsrAppCore.processFile (plugin:obsidian-spaced-repetition:12825:14)
at async OsrAppCore.loadVault (plugin:obsidian-spaced-repetition:12934:9)
at async _SRPlugin.sync (plugin:obsidian-spaced-repetition:26251:5)
at async eval (plugin:obsidian-spaced-repetition:26052:11)

Could it be that it isn't processing the spaced repetition if we aren't using the standard symbols for spaced repetition?

@st3v3nmw
Copy link
Owner

@Smitty010, I think that's the case.. The parser isn't handling the symbols correctly. What separators are you using?

@adakka
Copy link
Author

adakka commented Sep 21, 2024

I'm using "@@". This separator has worked perfectly in the previous versions.

st3v3nmw added a commit that referenced this issue Sep 21, 2024
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 added a commit that referenced this issue Sep 21, 2024
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
Copy link
Owner

I was able to reproduce @Smitty010's error based on what @adakka provided. The issue occurs when none of the "Convert X to clozes?" options are turned on which was messing up the parser. There's a fix in #1081. I'm waiting for a code review.. We'll release the fix ASAP.

st3v3nmw added a commit that referenced this issue Sep 21, 2024
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
@Smitty010
Copy link

Here's my data.json file if you want to test it:

{
  "settings": {
    "flashcardEasyText": "Easy",
    "flashcardGoodText": "Good",
    "flashcardHardText": "Hard",
    "flashcardTags": [
      "#flashcards",
      "#piano-flash",
      "#course-flash"
    ],
    "convertFoldersToDecks": false,
    "cardCommentOnSameLine": false,
    "burySiblingCards": false,
    "showContextInCards": true,
    "flashcardHeightPercentage": 80,
    "flashcardWidthPercentage": 40,
    "randomizeCardOrder": null,
    "flashcardCardOrder": "DueFirstRandom",
    "flashcardDeckOrder": "PrevDeckComplete_Sequential",
    "convertHighlightsToClozes": false,
    "convertBoldTextToClozes": false,
    "convertCurlyBracketsToClozes": false,
    "singleLineCardSeparator": ":>",
    "singleLineReversedCardSeparator": "<:>",
    "multilineCardSeparator": "?",
    "multilineReversedCardSeparator": "??",
    "editLaterTag": "#edit-later",
    "enableNoteReviewPaneOnStartup": true,
    "tagsToReview": [
      "#review"
    ],
    "noteFoldersToIgnore": [
      "SecondBrain/Templates",
      "SecondBrain/Attachments",
      "SecondBrain/AI Prompts",
      "SecondBrain/People"
    ],
    "openRandomNote": false,
    "autoNextNote": false,
    "disableFileMenuReviewOptions": false,
    "maxNDaysNotesReviewQueue": 365,
    "initiallyExpandAllSubdecksInTree": false,
    "baseEase": 250,
    "lapsesIntervalChange": 0.5,
    "easyBonus": 1.3,
    "maximumInterval": 36525,
    "maxLinkFactor": 1,
    "showDebugMessages": false,
    "showFileNameInFileLink": false,
    "singlelineCardSeparator": ":>",
    "singlelineReversedCardSeparator": "<:>"
  },
  "buryDate": "2024-09-15",
  "buryList": [],
  "historyDeck": "chatgpt-prompt"
}

st3v3nmw added a commit that referenced this issue Sep 21, 2024
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
Copy link
Owner

@adakka @yett1873 @Smitty010, please try the new release (v1.12.7) and let us know if it fixes the issue for you.

@adakka
Copy link
Author

adakka commented Sep 22, 2024 via email

@Smitty010
Copy link

That solved my problem as well

Newdea pushed a commit to open-spaced-repetition/obsidian-spaced-repetition-recall that referenced this issue 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
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants