Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -163,7 +167,9 @@ fn wrap_preserving_code(text: &str, width: usize) -> Vec<String> {
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 {
Expand Down
5 changes: 4 additions & 1 deletion tests/wrap_renumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}",
);
}
Loading