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

Adding support for CRLF in the parser #189

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

Mathys-Gasnier
Copy link
Collaborator

Description

People were complaning, so here is CRLF support, might cause issues with snippets code, but oh well.

Type of Change

  • ✨ New snippet
  • πŸ›  Improvement to an existing snippet
  • 🐞 Bug fix
  • πŸ“– Documentation update
  • πŸ”§ Other (please describe): Snippet parser

const propertyRegex = /^\s+([a-zA-Z]+):\s*(.+)/;
const headerEndCodeStartRegex = /^\s*---\s*```.*\n/;
const headerEndCodeStartRegex = /^\s*---\s*```.*\r?\n/;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's rarely used anymore but some systems (I think macs) used to use CR or \r for new line. Should we add support for that also?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we should worry about that, otherwise everything is going to get complicated, really quickly

@Mathys-Gasnier Mathys-Gasnier merged commit 87706b4 into dostonnabotov:main Jan 5, 2025
1 check passed
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.

3 participants