Alfresco removing script tags from html files

cancel
Showing results for 
Search instead for 
Did you mean: 
danieleff
Member II

Alfresco removing script tags from html files

When I save a html file that has a <script> tag in it, it is removed.

How can I disable this?

2 Replies
afaust
Master

Re: Alfresco removing script tags from html files

Where / how did you save the HTML file to Alfresco? Are you talking about the editor in the Wiki / Blog site components? When storing an HTML file in the document library or repository, Alfresco does NOT remove script tags, but if you are using a richtext editor UI (i.e. in Inline Edit, or the wiki / blog components), then Alfresco will strip out potentially harmful HTML content, including script tags. There is a (very old) blog post about the HTML black/whitelist processing that may help if you really think script-tags should be kept (generally, they should not).

danieleff
Member II

Re: Alfresco removing script tags from html files

Thank you for your reply. I will check that blog post, unfortunately scripts are needed (for example mathjax formulas...)

Simply drag and dropping a test.html into the project library with "<a>a</a><s>s</s>" and checking it in the "View in Browser" will give "<a>a</a>s"

I might somehow create a workaround as I have to create previews, editors for them. (Are there html editors on github I can base my work on?)