Skip to content
Svartz v2.6.0

@svartz/plugins/content

9 exported symbols.

Types

t ContentSlotWhich content slot (callout, code block, image, link, embed) renders each element of a note's HTML tree, the props that slot's component receives, and the attributes that survive sanitizing. The build compiles notes with it (`compileContent`), and `@svartz/ui` renders a preview in the browser with it, so both treat a tree the same way.

Functions

f activeContentSlotThe slot that renders `element` inside a tree, where `insideCode` says an ancestor is a code block's figure: the figure's own `<pre>` belongs to it, not to a slot of its own.
f containsCodeWhether `element`'s descendants are inside a code block, given whether `element` is.
f contentPropsThe props `slot`'s component gets for `element`, besides its children.
f contentSlotThe slot that renders `element`, or `undefined` for plain markup.
f isUnsafeElementWhether `element` is dropped, children and all.
f runsCodeWhether a browser would run `url` as a script or open it as an HTML document. Before it reads a URL's scheme, a browser drops the tabs and newlines anywhere in it and the spaces and control characters in front of it.
f safeAttributes`element`'s HTML attributes without event handlers, `srcdoc`, or script and HTML-document URLs.

Variables

v VOID_TAGS