-
Notifications
You must be signed in to change notification settings - Fork 260
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
Highcharts.AST.allowedAttributes #533
Comments
Thanks for reporting @Pascal76! Here's a sample showing how to use the node-export-server/tests/http/scenarios/allow_code_execution.json Lines 1 to 23 in ced7b17
The You can take a look at the CLI examples as well: node-export-server/tests/cli/scenarios/allow_code_execution_and_file_resources.json Lines 1 to 8 in ced7b17
Please try to follow this and let me know if it works for you. If not, please share the full log ( |
Thank you ! It works except for the border attribute (?!) while my JS file contains : Highcharts.AST.allowedTags.push('table'); What is not working : When I remove border=0 then it works. |
That is indeed strange. Could you please share the SVG that you're sending? Is there a way for me to replicate this locally? |
also if the json file contains comments like Wed Jun 05 2024 12:28:02 GMT+0200 [error] - [pool] In pool.postWork: Error encountered during export: 6.174512ms. |
@Pascal76 the JSON file cannot contain comments: https://stackoverflow.com/questions/244777/can-comments-be-used-in-json If the provided JSON file is not proper, there will be an error (most likely) which would resemble the one that you've attached above. Regarding the allowed tags & attributes, I will investigate why that happens. |
Closing due to inactivity. Summary:
|
Hello @jszuminski |
I spoke about issue with border=0 |
Hello,
How can I use Highcharts.AST.allowedAttributes with /usr/local/bin/highcharts-export-server (v4) please ?
I tryed using --customCode "AST.allowedAttributes.js"
but it does not work.
The file contains:
Highcharts.AST.allowedAttributes.push('border');
Highcharts.AST.allowedAttributes.push('align');
Highcharts.AST.allowedAttributes.push('bordercolor');
Highcharts.AST.allowedAttributes.push('zIndex');
Highcharts.AST.allowedAttributes.push('bgcolor');
Highcharts.AST.allowedAttributes.push('cellpadding');
Highcharts.AST.allowedAttributes.push('cellspacing');
Highcharts.AST.allowedTags.push('center');
Highcharts.AST.allowedAttributes.push('center');
On the Dockerfile:
WORKDIR /node-export-server
ADD ["AST.allowedAttributes.js","/node-export-server"]
RUN chown -R node /node-export-server &&
chmod 644 AST.allowedAttributes.js
The command line :
/bin/docker run -u 0:0 -v /apache_sites/jbm:/apache_sites/jbm --rm --tmpfs=/run highcharts_es timeout 10 /usr/local/bin/highcharts-export-server --allowCodeExecution true --infile /apache_sites/jbm/b.json --outfile /apache_sites/jbm/web/img/toto.png --resources '[]' --customCode AST.allowedAttributes.js --width 720 --height 320 --scale 1.2 --logLevel 4
The text was updated successfully, but these errors were encountered: