edge:remove

The edge:remove boolean global attribute removes the element from the deployed page. Its lines stay, but they are empty, so line numbers stay the same.

Syntax

html
<iframe src=About.html edge:remove></iframe>
<div edge:remove>Local notes</div>

Value

Boolean

The attribute needs no value: its presence turns removal on for the element.

Description

On deploy, the element becomes as many line breaks as it spanned, minus one, so its lines stay but are empty. A one-line element leaves one empty line.

AttributeWhat the deployed page holds
edge:removeEmpty lines where the element was. Nothing marks the spot.
edge:redactA <!--REDACTED … --> comment on the same lines.

The element still produces its exports and assets. An element with o: or worker:fs is extracted first, and its own body is not removed from the export.

The attribute applies anywhere: inside <template> content, and inside the export bodies of other elements. It runs before edge:redact, so an element with both is removed.

In the playground neither attribute does anything: the output renders and runs the element. Code: Size shows a ⚑ count of the elements that are stripped or redacted on deploy.

Usage notes

Playground-only parts

Use edge:remove for parts of the source that belong in the playground but not in the deployed page: preview frames, diagnostics, test harnesses and notes. Use edge:redact instead when a comment that marks the spot is fine.

Removal is not secrecy

Warning: edge:remove only changes the served HTML. The deployed source, opened with ?, still contains the element, and so does every saved version. The source is public unless the deployment has access rules. See Keeping secrets out.

Line counts

The number of lines comes from the serialized element, not from your source text. Line breaks between attributes inside a multi-line start tag are lost, so a start tag spread over three lines counts as one, and a newline character reference such as &#10; adds a line. Keep start tags on one line when later line numbers in the deployed page must match the source.

Worker assets

worker:fs does not take the element off the page. Add edge:remove to keep a data block out of the served HTML while the worker still reads it. See worker:fs.

On deploy

edge:remove is stripped from the served page together with the other edge: attributes. The deployed source keeps it.

Examples

A preview that is not deployed

html
<h1>My site</h1>
<template o:=About.html edge:redact><h1>About</h1></template>
<iframe src=About.html edge:remove style=position:fixed;inset:0;width:100%;height:100%;border:0;background:Canvas></iframe>

The frame covers the page in the playground. On RTEdge.net it leaves an empty line, so the home page shows its own heading.

Removing inside an export

html
<div o:=card.html class=x>Hi
<span edge:remove>x</span></div>
<iframe src=card.html></iframe>

The playground serves the whole element, span included.

The exported body on RTEdge.net

RTEdge.net serves /card.html from a cleaned copy, without the RTCode attributes and without the span:

plain
<div class="x">Hi
</div>

Specifications

Not part of any specification. edge:remove is an RTCode.io and RTEdge.net feature.

It builds on these standards:

Specification
HTML Standard: Syntax

Availability

FeaturePlaygroundRTEdge.netNotes
Removing the elementNo effectYesApplied on deploy.
Exports from the elementYesYesThe export is produced before the element is removed.
Count of removed elements in Code: SizeYesNoA ⚑ count.
Agent File Sync (Agent Folder Share)YesNoSynced files hold the authored source, removed elements included. Chrome or Edge on desktop.

See also