Every extension

youtube

Node 0.77 kB gzipped

A YouTube video, embedded.

Only the id is stored. The frame's address is built from it here, on the privacy-preserving domain, so a document can never carry a frame pointing anywhere else — an embed whose `src` is trusted from JSON is an `<iframe>` to any page an attacker likes.

Adding it

import { createEditor, document, paragraph, text, youtube } from '@matrajs/core'

const editor = createEditor({
  extensions: [document, paragraph, text, youtube],
  element: document.querySelector('#editor'),
})

There is no separate package · youtube is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.

Commands

Attributes

HTML

Styles

This one needs a stylesheet to look right, and ships the minimum as a string rather than a file · nothing is loaded unless you load it.


          import { youtubeCSS } from '@matrajs/core'

const style = document.createElement('style')
style.textContent = youtubeCSS
document.head.append(style)
        

← All 81 extensions

Edit this page on GitHub