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: Unsupported marker content in checkboxes #156

Closed
wants to merge 1 commit into from
Closed

Fix: Unsupported marker content in checkboxes #156

wants to merge 1 commit into from

Conversation

micsama
Copy link

@micsama micsama commented Sep 24, 2024

This PR addresses an issue where unsupported markers inside [ ] brackets in checkboxes cause errors during rendering, which prevents the Markdown from being displayed correctly.

Problem Details:

When opening a Markdown file containing unsupported checkbox content, an error occurs, leading to a failure in rendering the Markdown. The error message observed is:

Error executing Lua callback: ...al/share/nvim/lazy/markview.nvim/Lua/markview/parser.Lua:658: invalid capture index
Stack traceback:
c: in function 'find'

This fix is crucial because the error prevents proper rendering of Markdown files containing these specific checkbox markers. By addressing this issue, the plugin will provide a more robust and error-free experience when working with checkboxes, ensuring that users can render their Markdown content correctly without interruption.

I would like to thank the author for this great plugin. I really enjoy using it, and I appreciate all the hard work that has gone into making it so helpful!

@micsama micsama closed this Sep 24, 2024
@micsama micsama deleted the fix-unsupported-marker branch September 24, 2024 03:01
@micsama micsama restored the fix-unsupported-marker branch September 24, 2024 03:04
@micsama micsama deleted the fix-unsupported-marker branch September 24, 2024 03:04
@micsama micsama restored the fix-unsupported-marker branch September 24, 2024 03:04
@micsama micsama reopened this Sep 24, 2024
@OXY2DEV
Copy link
Owner

OXY2DEV commented Sep 24, 2024

unsupported markers inside [ ].

There shouldn't be any unsupported markers. When did the error occur?

@micsama
Copy link
Author

micsama commented Sep 24, 2024

unsupported markers inside [ ].

There shouldn't be any unsupported markers. When did the error occur?

I open a file with marker like '[1]', although I realize this might be an incorrect marker. If the plugin encounters this marker, it could cause issues and won't work. Therefore, we
should add an error-checking mechanism here to inform the user if there is a problem.

@OXY2DEV
Copy link
Owner

OXY2DEV commented Sep 24, 2024

Ah, I found the issue.

I was doing %1, a bit of an oversight on my part.


I unfortunately can't merge this, as I have reworked a bit how list items work.

So, the code looks a bit different now(check dev branch).

Also parser.escape_string() is now used to fix this issue as this doesn't cause an error and doesn't stop users from using numbers for special checkboxes.

Thanks for the PR!

@OXY2DEV OXY2DEV closed this Sep 24, 2024
OXY2DEV added a commit that referenced this pull request Sep 24, 2024
@micsama
Copy link
Author

micsama commented Sep 24, 2024

Ah, I found the issue.

I was doing %1, a bit of an oversight on my part.

I unfortunately can't merge this, as I have reworked a bit how list items work.

So, the code looks a bit different now(check dev branch).

Also parser.escape_string() is now used to fix this issue as this doesn't cause an error and doesn't stop users from using numbers for special checkboxes.

Thanks for the PR!

okey, I'll check dev branch ,and try it

@micsama micsama deleted the fix-unsupported-marker branch September 24, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants