diff --git a/src/wrap.rs b/src/wrap.rs index 314fa572..3a1b06c8 100644 --- a/src/wrap.rs +++ b/src/wrap.rs @@ -15,6 +15,10 @@ mod tokenize; /// Token emitted by [`tokenize::segment_inline`] and used by higher-level /// wrappers. /// +/// Downstream callers inspect [`Token<'a>`] when implementing bespoke +/// wrapping logic. The `'a` lifetime parameter ties each token to the source +/// text, avoiding unnecessary allocation. +/// /// Re-export these so callers of [`crate::textproc`] can implement custom /// transformations without depending on internal modules. pub use tokenize::Token; @@ -163,7 +167,9 @@ fn wrap_preserving_code(text: &str, width: usize) -> Vec { lines } +/// Checks if a line is a fence marker (````` or `~~~`), ignoring leading whitespace. #[doc(hidden)] +#[rustfmt::skip] pub fn is_fence(line: &str) -> bool { FENCE_RE.is_match(line) } pub(crate) fn is_markdownlint_directive(line: &str) -> bool { diff --git a/tests/wrap_renumber.rs b/tests/wrap_renumber.rs index ae7c0ad6..73d0d6f3 100644 --- a/tests/wrap_renumber.rs +++ b/tests/wrap_renumber.rs @@ -13,5 +13,8 @@ fn wrap_then_renumber_preserves_order() { let mut out = process_stream(&input); out = renumber_lists(&out); - assert_eq!(out, expected); + assert_eq!( + out, expected, + "renumbered output mismatch:\nexpected: {expected:?}\nactual: {out:?}", + ); }