Document apiReference

htmlToFragment

Convert an HTML string into an SDM/1 structural fragment.

read-onlyidempotent
doc.htmlToFragment(…)

Expected result

Returns an SDHtmlToFragmentResult with the converted fragment, lossy flag, and diagnostics.

Inputs

htmlstringrequired

Result

Output fields
fragmentparagraph | heading | list | table | horizontalRule | paragraph | heading | list | table | horizontalRule[]required
paragraph / heading / list / table / horizontalRule
paragraph
idstring
kind"paragraph"required
paragraphobjectrequired
heading
idstring
kind"heading"required
headingobjectrequired
list
idstring
kind"list"required
listobjectrequired
table
idstring
kind"table"required
tableobjectrequired
horizontalRule
idstring
kind"horizontalRule"required
horizontalRuleobjectrequired
Variant 2

No fields.

lossybooleanrequired
diagnosticsobject[]required

Failures

Pre-apply throws

  • CAPABILITY_UNAVAILABLE
  • INVALID_INPUT

Raw schemas

Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.

View raw JSON schemas