Skip to content

rendersAsBlock

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/web/src/components/Viewer/blockNesting.ts

Does this child render as block-level content?

isVideoHref is injected rather than imported so this module stays free of the renderer's ESM dependency graph; MarkdownRenderer passes its own known-host allowlist check (a bare link to youtube/vimeo/loom becomes a

embed, so it is block too).

Signature

ts
function rendersAsBlock(child: HastChild | null | undefined, isVideoHref: (href: string) => boolean): boolean

Parameters

NameType
child`HastChild
isVideoHref(href: string) => boolean

Returns: boolean

Was this page helpful?

Download as PDF