HTML
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 that have predefined validators and only allow specific "whitelisted" HTML to be inserted.

Example

Example:
1
module.exports = {
2
"name": "tweet",
3
"label": "Tweet",
4
"html": dedent``
5
<div class="embed-container">
6
<div doc-html="tweet">
7
<div class="embed tweet">
8
<div class="placeholder"></div>
9
</div>
10
</div>
11
</div>
12
`
13
}
Copied!

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 validation
  • iframe -> only allow iframe embeds
  • tweet -> only allow twitter embeds
Use of the client-side embeds (html directive) is not recommended. We advise you to use includes and write your own micro-service to control the rendering of third-party embeds.
Last modified 9mo ago
Copy link