-
Notifications
You must be signed in to change notification settings - Fork 24
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
Find and replace strings in HTML files #77
Comments
Well, off-hand my first thought is to just do it on the CLI in a post build hook. I.e. within
Of course this is just using unix to your advantage rather than doing anything with javascript. What exactly is the use case here? Why not modify your template file and just generate the HTML you will want in the end? |
Thanks @iansinnott, I will try out your suggestion. Sorry, I should have explained my use-case. I'm working on a site that has most pages rendered by Django but also some React SPA pages. To be able to use some common presentational components across, I would like to generate them as partials with template variables instead of content. The main problem I found is that React HTML encodes all quotes etc. and since I found no way of changing Reacts behaviour my idea was to replace all the encoded entities back to what they need to be (ie. replace |
Ah, interesting. I hadn't thought of that use case. Yeah you could still use If you have a CLI tool to unescape HTML you might be able to simply run the whole HTML file through that program. |
Hi, have the need to be able to replace some contents in the resulting HTML after they're generated. I tried "string-replace-webpack-plugin" and "html-replace-webpack-plugin" but could not get them to work. Any ideas how to accomplish this?
The text was updated successfully, but these errors were encountered: