Untrusted data quarantine
::data blocks isolate user-supplied content under the untrusted-data security profile.
CLI htx compile --security-profile untrusted-data WASM playground uses the html profile only; preview shows CLI output.
::section { variant="bad" }
Injected
::
Normal paragraph.
HTX source
::data { type="untrusted-user-content" }
::section { variant="bad" }
Injected
::
Normal paragraph.
::
{
"type": "root",
"children": [
{
"type": "block_directive",
"tag": "data",
"attributes": {
"custom": {
"type": "untrusted-user-content"
}
},
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "::section { variant=\"bad\" }",
"trust": "untrusted",
"loc": {
"start": {
"line": 2,
"column": 3,
"offset": 43
},
"end": {
"line": 2,
"column": 5,
"offset": 45
}
}
}
],
"trust": "untrusted",
"loc": {
"start": {
"line": 2,
"column": 3,
"offset": 43
},
"end": {
"line": 2,
"column": 5,
"offset": 45
}
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Injected",
"trust": "untrusted",
"loc": {
"start": {
"line": 3,
"column": 1,
"offset": 71
},
"end": {
"line": 3,
"column": 13,
"offset": 83
}
}
}
],
"trust": "untrusted",
"loc": {
"start": {
"line": 3,
"column": 1,
"offset": 71
},
"end": {
"line": 3,
"column": 13,
"offset": 83
}
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "::",
"trust": "untrusted",
"loc": {
"start": {
"line": 4,
"column": 3,
"offset": 86
},
"end": {
"line": 4,
"column": 5,
"offset": 88
}
}
}
],
"trust": "untrusted",
"loc": {
"start": {
"line": 4,
"column": 3,
"offset": 86
},
"end": {
"line": 4,
"column": 5,
"offset": 88
}
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Normal paragraph.",
"trust": "untrusted",
"loc": {
"start": {
"line": 5,
"column": 1,
"offset": 89
},
"end": {
"line": 5,
"column": 20,
"offset": 108
}
}
}
],
"trust": "untrusted",
"loc": {
"start": {
"line": 5,
"column": 1,
"offset": 89
},
"end": {
"line": 5,
"column": 20,
"offset": 108
}
}
}
],
"trust": "untrusted",
"loc": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 6,
"column": 3,
"offset": 111
}
}
}
]
}