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

The regex for YAML closing delimiter is to permissive #1347

Closed
saf-dmitry opened this issue Mar 20, 2024 · 0 comments
Closed

The regex for YAML closing delimiter is to permissive #1347

saf-dmitry opened this issue Mar 20, 2024 · 0 comments
Labels
bug Something isn't working foam-core Related to API, core model or feature good first issue Good for newcomers
Milestone

Comments

@saf-dmitry
Copy link

Describe the bug

Strings like -.. are recognized as YAML closing delimiter.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

This will be recognized as YAML frontmatter:

---
key: value
-..

Expected behavior

Strings like -.. are not recognized as YAML closing delimiter.

Screenshots or Videos

No response

Operating System Version

  • OS: macOS 10.11

Visual Studio Code Version

v1.87

Additional context

The regex for YAML closing delimiter is to permissive, allowing false positives like e.g., -... More correct regex would be:

const LAST_DELIMITER_MATCH = /^([-]{3}|[.]{3})\s*?$/g;
@riccardoferretti riccardoferretti added bug Something isn't working good first issue Good for newcomers foam-core Related to API, core model or feature labels Mar 21, 2024
@riccardoferretti riccardoferretti added this to the backlog milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working foam-core Related to API, core model or feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants