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

python highlighting fails with initial blank line or comment #1397

Open
leeharr opened this issue Jun 28, 2024 · 4 comments
Open

python highlighting fails with initial blank line or comment #1397

leeharr opened this issue Jun 28, 2024 · 4 comments

Comments

@leeharr
Copy link

leeharr commented Jun 28, 2024

Describe the issue

Codemirror 6, very basic setup with python highlighting.

Everything works fine, unless the first line is blank or a comment.

If the first line is a comment, that line is highlighted, but the rest of the text is rendered plain.
If the first line is blank, none of the text gets highlighted.

Browser and platform

No response

Reproduction link

No response

@marijnh
Copy link
Member

marijnh commented Jun 28, 2024

If I try to reproduce this, I don't see the issue.

@leeharr
Copy link
Author

leeharr commented Jun 28, 2024

Ok. I'm not using the module method. I have a bundle.js that I built following the steps in codemirror-quickstart [https://github.com/RPGillespie6/codemirror-quickstart].

Maybe I need to learn how to use the module method.

Thanks for looking at this!

@leeharr
Copy link
Author

leeharr commented Jun 28, 2024

I'm starting to understand this more now.

This Try Codemirror gives a better description of what I actually have.

I just copied the editor.js from the bundle building instructions and changed the one thing (javascript for python) and added a bit at the bottom to display the editor in the document.body for Try.

Unfortunately (or fortunately) comments are working fine in the Try Codemirror.

Any hints as to why it would not work the same when the bundle is loaded into my app?

@marijnh
Copy link
Member

marijnh commented Jun 28, 2024

I really don't know what could cause this. Without a way to reproduce it I don't think I can help much.

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

No branches or pull requests

2 participants