convert function
Converts html to Markdown over the in-process native bridge.
The synchronous call is the preserved public shape: the bridge is
synchronous, so the result is available without an await. The typed
failures (InvalidInputException, ConversionErrorException) surface
through checkLastError.
visitor travels out of band — it is a callback, not JSON.
Implementation
ConversionResult convert(
String html, {
ConversionOptions? options,
Visitor? visitor,
}) {
final resultJson = convertWithNativeLibrary(
html,
optionsJson: optionsJsonOf(options),
visitor: visitor,
);
return conversionResultFromJson(resultJson);
}