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

Regular expression for scriptHost doesn't work for some urls [Fix included!] #19

Open
jpadvo opened this issue Oct 5, 2010 · 0 comments

Comments

@jpadvo
Copy link

jpadvo commented Oct 5, 2010

[I'm a noob. I learned about the ability to request a pull, so I did that with this code. Cheers! ]

I am building a wordpress theme, and have topup installed in a folder with this url:

http://localhost/project_name/wp-content/themes/theme_name/topup/javascripts/top_up.js

But scriptHost returns as follows:

http://localhost/images/top_up/

This can be fixed by replacing the regular expression inside scriptHost (line 15) as follows:

current: /^\w+:///
fixed: /./(?=([^\/])(/[^\/]*)$)/

This uses a positive lookahead to trim off 'javascripts/top_up.js' or 'javascripts/top_up-min.js'.

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

No branches or pull requests

1 participant