-
-
Notifications
You must be signed in to change notification settings - Fork 312
Content in <script> should be ignored. #13
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
Comments
Thanks for the feedback. |
How about using a regular expression. I think this would work in 99% of the cases.
|
I prefer not to use regular expressions because this can solves this problem but generate others. The content of the script elements can be anything and can contain others html elements (even javascript elements) as string, commented code, templates, etc, so generate a solid regular expression that work in all cases is very difficult. |
True, in some cases it might cause trouble. Luckily I'm rather good in writing regular expressions 😄. So here's a fail safe version:
Breaking down the regex (left out escaping the php string):
|
Wow, that's pretty good!! |
I see that the single quote is missing from the possessive match of non-special characters. That might be causing the problem. |
My approach is actually wrong. If there is a |
Thank you, seems to work now. I'm going to add you as a contributor. |
Embedding this articles returns an invalid image URL with am
<%= image >
tag in it.If I look at the source, I see that the image tag is actually inside a
<script type="text/template">
tag. This is common when a website uses a javascript templating engines.The text was updated successfully, but these errors were encountered: