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

Unintended replacement in template files #43

Open
tendant opened this issue Jun 9, 2019 · 2 comments
Open

Unintended replacement in template files #43

tendant opened this issue Jun 9, 2019 · 2 comments

Comments

@tendant
Copy link

tendant commented Jun 9, 2019

Is there a way to disable embedded elisp replacement in template files?

It tries to replace below minified JavaScript code (from highlight.js):

function(e){return{sL:"xml",c:[{cN:"meta",b:"^__(END|DATA)__$"},{b:"^\\s*%{1,2}={0,2}",e:"$",sL:"perl"},{b:"<%{1,2}={0,2}",e:"={0,1}%>",sL:"perl",eB:!0,eE:!0}]}});

__(END|DATA)__ doesn't need replacement. It is also kind of dangerous to try to replace blindly.

The replacement will cause error:

Error: (void-function END|DATA) replace-regexp-in-string: Wrong type argument: stringp, nil

tendant referenced this issue in sergey-pashaev/skeletor.el Jun 9, 2019
@tendant
Copy link
Author

tendant commented Jun 9, 2019

In same js file "highlight.js", it contains a lot keywords like "__NAME__", "__DATE__" etc, which are not supposed to be replaced.

It will be great to be able to turn off replacement completely for certain files.

Any idea on possible solutions?

@tendant
Copy link
Author

tendant commented Jun 11, 2019

Tried to add template configuration(:skip-file) to skip certain files from string replacement.

Detail can be found in tendant@1c3e640

It solve this problem by skipping problematic files. This issue is also related to another pull request: #39.

Please advice what's the best way to incorporate it in master branch.

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