pub fn render_document_with_spans(
ast: &[Element],
config: &RenderConfig<'_>,
input: &str,
) -> StringExpand description
Render a document to semantic HTML with span data attributes
Each element will have data-start and data-end attributes with UTF-16 offsets.
This is useful for editor synchronization (e.g., highlighting preview elements based on cursor position).
ยงArguments
ast- The parsed AST elementsconfig- Render configuration (include_spans should be true)input- Original input text for UTF-16 offset calculation