Skip to main content

normalize_lists

Function normalize_lists 

Source
pub fn normalize_lists(content: &str) -> String
Expand description

Normalize lists in content with both indentation and bullet style fixes.

Combines indentation normalization (2-space increments) and bullet style normalization (consistent - style) in a single pass.

ยงExamples

use ascfix::lists::normalize_lists;

let content = "- Item 1\n    * Nested with 4 spaces\n+ Item 2";
let normalized = normalize_lists(content);
assert!(normalized.contains("- Item 1"));
assert!(normalized.contains("  - Nested with 4 spaces")); // 2 spaces, normalized
assert!(normalized.contains("- Item 2")); // + changed to -