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

Cloze and remnote notes conflict with code blocks #76

Closed
OliverBalfour opened this issue May 16, 2021 · 5 comments
Closed

Cloze and remnote notes conflict with code blocks #76

OliverBalfour opened this issue May 16, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@OliverBalfour
Copy link

First things first, this is an awesome plugin, thank you for making this!

I've just spent a little time testing and found the following issue. If I have a code block like the following two:

a == b && b == c
std::vector x{};

The plugin will detect the first as a Cloze task and the second as a remnote one, and has weird prompts when you open the flashcard review screen. I think anything inside code blocks should be ignored if possible (but being able to put code blocks after a multiline ? prompt is great)

@st3v3nmw
Copy link
Owner

Hello, I'm glad that you like the plugin!

I'll work on fixing this.

Thanks for the bug report.

@st3v3nmw st3v3nmw added the bug Something isn't working label May 16, 2021
@OliverBalfour
Copy link
Author

Thanks!

One other issue I've just noticed: if I have a note like

How do you create a computed property in Python?
?
```
one line

another line
```

then it gets changed to

How do you create a computed property in Python?
?
```
one line
<!--SR:2021-05-20,4,270-->

another line
```

Perhaps the multiline notes should ignore blank lines if they're in the middle of a code block? This isn't a huge problem as I can add some spaces to the blank line to make the plugin skip that line

@Masstronaut
Copy link

On version 1.5.2 I'm still seeing the issue @OliverBalfour mentioned in code blocks with blank lines. Adding spaces works, but it would definitely be preferable to have the entire code block be treated as a single block for review.

I tested with having a block reference ^likethis immediately after a code block. That worked great:

  1. The block reference wasn't included in the card
  2. The SR HTML comment was inserted after the block reference, so it won't break any block references I have to that code block.

@st3v3nmw
Copy link
Owner

st3v3nmw commented Jun 9, 2021

@Masstronaut, I only did a partial fix for this issue so the blank lines bit is still pending. Changing the regex to accommodate this got a little too complicated so I decided to fix other things first.

@st3v3nmw
Copy link
Owner

st3v3nmw commented Jun 9, 2021

I'll create a new issue for the blank lines bit & close this one.

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

No branches or pull requests

3 participants