cmark_resume_with_source_range_and_options

Function cmark_resume_with_source_range_and_options 

Source
pub fn cmark_resume_with_source_range_and_options<'a, I, E, F>(
    event_and_ranges: I,
    source: &'a str,
    formatter: F,
    state: Option<State<'a>>,
    options: Options<'_>,
) -> Result<State<'a>, Error>
where I: Iterator<Item = (E, Option<Range<usize>>)>, E: Borrow<Event<'a>>, F: Write,
Expand description

Serialize a stream of pulldown-cmark-Events while preserving the escape characters in source. Each input Event is accompanied by an optional Range that maps it back to the source string.

Different from cmark_resume_with_options, which always escape Markdown special characters like # or [, this function only escapes a special character if it is escaped in source.

  1. source
    • Markdown source from which event_and_ranges are created.
  2. event_and_ranges
  3. formatter
    • A format writer, can be a String.
  4. state
    • The optional initial state of the serialization, useful when the operation should be resumed.
  5. options
    • Customize the appearance of the serialization. All otherwise magic values are contained here.

Returns the State of the serialization on success. You can use it as initial state in the next call if you are halting event serialization.

Errors if the underlying buffer fails (which is unlikely) or if the Event stream iterated over by event_and_ranges cannot ever be produced by deserializing valid Markdown. Each failure mode corresponds to one of Error’s variants.