The use of
doc-html
is not recommended. We advise you to use includes to control the rendering of HTML on the server.HTML directives allow you to insert arbitrary HTML within the tag on which the directive is specified. The idiomatic use case is the free-html component. But you can also use embeds (iframe, tweet) that have predefined validators and only allow specific HTML to be inserted.
Example
{
name: 'tweet',
label: 'Tweet',
html: dedent`
<div class="embed-container">
<div doc-html="tweet">
<div class="embed tweet">
<div class="placeholder"></div>
</div>
</div>
</div>
`
}
Config Options
There are no config options. The automatic validation is hardcoded for a set of given embeds and is recognized by the name of the directive:
free-html
-> no validationiframe
-> only allow iframe embedstweet
-> only allow twitter embeds