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>
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
.
- source
- Markdown source from which
event_and_ranges
are created.
- Markdown source from which
- event_and_ranges
- An iterator over
Event
-range pairs, for example as returned bypulldown_cmark::OffsetIter
. Must match what’s provided insource
.
- An iterator over
- formatter
- A format writer, can be a
String
.
- A format writer, can be a
- state
- The optional initial state of the serialization, useful when the operation should be resumed.
- 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 are only happening if the underlying buffer fails, which is unlikely.