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

Blank lines in codeblocks #148

Closed
Tracked by #211
st3v3nmw opened this issue Jun 9, 2021 · 5 comments · Fixed by #229
Closed
Tracked by #211

Blank lines in codeblocks #148

st3v3nmw opened this issue Jun 9, 2021 · 5 comments · Fixed by #229
Labels
bug Something isn't working

Comments

@st3v3nmw
Copy link
Owner

st3v3nmw commented Jun 9, 2021

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

Originally posted by @OliverBalfour in #76 (comment)

@st3v3nmw
Copy link
Owner Author

st3v3nmw commented Jun 9, 2021

Kinda related to #122.

@st3v3nmw st3v3nmw added the bug Something isn't working label Jun 9, 2021
@bjoernwe
Copy link

There's a similar issue when the question is a code block with an empty line:

```python
x = True

print(x)
```
?
```python
True
```

The flashcard will only show "print(x)" (as regular text - not code).

@st3v3nmw st3v3nmw mentioned this issue Jul 31, 2021
17 tasks
@st3v3nmw
Copy link
Owner Author

st3v3nmw commented Aug 7, 2021

Fix should be available in the next release once I'm done with testing.

@OliverBalfour
Copy link

Awesome, thanks for doing this! I've just noticed a subtle bug with this new behaviour though:

  1. Set "Save scheduling comment on the same line as the flashcard's last line?" to true
  2. Add a card with a multiline code block answer
  3. Review the card

What happens is pretty predictable: the comment is added on the same line as the three backticks:

image

However, then the three backticks don't close the code block and everything afterwards including other SRS cards is included, giving some very funky behaviour.

Disabling the same line setting is a good temp fix but I think the same line setting should simply not apply to code blocks

@st3v3nmw
Copy link
Owner Author

@OliverBalfour, this should be fixed in the next release.

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.

3 participants