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

replace letter to $ issue #30

Open
missyoyo opened this issue Mar 1, 2020 · 1 comment
Open

replace letter to $ issue #30

missyoyo opened this issue Mar 1, 2020 · 1 comment

Comments

@missyoyo
Copy link

missyoyo commented Mar 1, 2020

Hello:
I am new guy use replace-filter-nginx-module, I want insert some javascript to html body. And my javascript code contain $. When try $$ like this:
replace_filter '' '<script>$$(document).ready(function(){$$(".panel-container").eq(-1).hide();});</script>' g;
I need it to be '<script>$(document).ready(function(){$(".panel-container").eq(-1).hide();});</script>'.
But I still get two $$ as result
图片
Thank you for your help.

@Z3r0byte
Copy link

I also came across this issue and after inspecting the source code I couldn't find why it didn't work. I then started looking for a work-around and found that this works:

Place the following in the http block of your nginx config:

    geo $dollar {
        default "$";
    }

Then, you can use ${dollar} in your replace_filter rules to get a single $.

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

2 participants