GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.07k stars 407 forks source link

Support web components in HTML ? #674

Closed antoninadert closed 4 years ago

antoninadert commented 4 years ago

I wanted to have clap buttons like in Medium, so I used the custom HTML feature of the editor. I realized that web components are automatically trimmed out of the HTML (javascript scripts work fine though).

The author of the applause button has created a web component for integrating with its API. I can't use it in Publii to add the feature in all my posts right now.

What I can do is create a full javascript code that would do the same, but I wanted to know how far we are from directly supporting web components in the HTML editor.

Thanks for your help,

dziudek commented 4 years ago

Hi,

If you want to use custom HTML elements - you have to edit TinyMCE editor settings to allow all possible tags. I have described it here: https://github.com/GetPublii/Publii/issues/367#issuecomment-471542079

I am closing this topic as it is not an issue to solve on the app level.

lrq3000 commented 4 years ago

I tried to use ink-components, which are web components to make explorable explanations. I think Publii can be a great tool to combine with explorable explanations. But it's not clear how the web components can be added since they are trimmed automatically and there is no option.

I saw the fix you outline in #367, would it be possible to simply add an option in the parameters to modify the extended_valid_elements in TinyMCE please? Or even better, a simple checkbox to accept any custom HTML tags/web components by creating the file and inputting:

{
"extended_valid_elements": "*[*]"
}

As you suggested.

I expect web components are going to be more and more prevalent, so I think this would be a great addition, particularly for those interested in publishing explorable explanations.