convert function

ConversionResult convert(
  1. String html, {
  2. ConversionOptions? options,
  3. Visitor? visitor,
})

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);
}