Skip to content

Fix language indicator regex in magics #1307

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Jiya873
Copy link

@Jiya873 Jiya873 commented Apr 4, 2025

Fixes #1236 by updating the lang_indicator regex in magics.py to correctly detect language specifiers in code blocks. The new pattern ensures that the language name appears immediately after the triple backticks, followed by a space and a newline. This prevents incorrect matches and improves compatibility with markdown syntax.

Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jiya873 Welcome, and thank you for contributing! We're really happy to see people interested in the project. Left some feedback for you below. 🤗

@dlqqq dlqqq changed the title changed lang_indicator Fix language indicator regex in magics Apr 4, 2025
@dlqqq dlqqq added bug Bugs reported by users scope:magics Issues concerning the magic commands labels Apr 4, 2025
Copy link
Author

@Jiya873 Jiya873 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the code as suggested

@dlqqq
Copy link
Member

dlqqq commented Apr 7, 2025

@Jiya873 The unit tests are not passing. Can you help reproduce the error locally using pytest, then fix the tests added here?

@Jiya873
Copy link
Author

Jiya873 commented Apr 7, 2025

Thank you for the feedback. I’ll run pytest locally to check the errors. I might need a bit of time to look into it, but I’ll work on fixing the failing tests and update you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs reported by users scope:magics Issues concerning the magic commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify regex
2 participants