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 incorrect negative lookahead pattern #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

forivall
Copy link

@forivall forivall commented May 6, 2021

seems like you had based the syntax on a jsdoc syntax and missed this? idk. anyways, this works.

seems like you had based the syntax on a jsdoc syntax and missed this? idk. anyways, this works.
@forivall
Copy link
Author

forivall commented May 7, 2021

I finally fixed my issues with the following gist: https://gist.github.com/forivall/d6a1fbc1ca902670ad51973b974ac177 - does what #71 does, although it doesn't highlight the html, but that's good enough for me.

@Betanu701
Copy link
Member

Betanu701 commented Feb 8, 2023

@forivall I know this is really late. Sorry! Can you show me the output of both versions so that I can see exactly what this fixes?

@@ -136,7 +136,7 @@
"tag-ejs-multi-line": {
"contentName":"source.js",
"name": "meta.block.ejs",
"begin":"(<[%?](?:(?!php))[%_=-]?)(?!(\\s*\\*\/))",
"begin":"(<[%?](?:(?!php))[%_=-]?)(?!([_-]?[%?]>))",
Copy link
Author

Choose a reason for hiding this comment

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

Suggested change
"begin":"(<[%?](?:(?!php))[%_=-]?)(?!([_-]?[%?]>))",
"begin":"(<[%?](?:(?!php))[%_=-]?)(?!([^%]*?[_-]?[%?]>))",

@forivall
Copy link
Author

forivall commented Feb 10, 2023

Looking at the old code i was working on, it looks like the situation was ejs inside of an html attribute - for example:

<a href="<%= data.link.url %>">some text here, will still be "javascript" scope without this change</a> still javascript here

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