pub fn normalize_markdown(markdown: &str) -> StringExpand description
Normalizes markdown content by applying all preprocessing steps.
This function applies normalizations in the correct order:
- Strip Unicode bidirectional formatting characters
- Fix HTML comment closing fences (ensure text after
-->is preserved)
Note: Guillemet preprocessing (<<text>> → «text») is handled separately
in normalize_fields because it needs to be applied after schema defaults
and coercion.
§Examples
use quillmark_core::normalize::normalize_markdown;
// Bidi characters are stripped
let input = "**bold** \u{202D}**more**";
let normalized = normalize_markdown(input);
assert_eq!(normalized, "**bold** **more**");
// HTML comment trailing text is preserved
let with_comment = "<!-- comment -->Some text";
let normalized = normalize_markdown(with_comment);
assert_eq!(normalized, "<!-- comment -->\nSome text");