process_safe

Function process_safe 

Source
pub fn process_safe<F>(content: &str, processor_fn: F, fallback: &str) -> String
where F: FnOnce(&str) -> String,
Expand description

Safely process markup content with error recovery.

Provides a safe wrapper around markup processing operations that may fail, and ensures that partial or fallback content is returned rather than complete failure.

§Arguments

  • content - The content to process
  • processor_fn - The processing function to apply
  • fallback - Fallback content to use if processing fails

§Returns

The processed content or fallback on error