From 82b2555d858cc94c4c9b5655ee820d80540ea509 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Fri, 19 Jun 2026 08:19:24 +0300 Subject: Add some docs to r2md-fence and fence_wrapper --- src/fence_wrapper.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/fence_wrapper.rs') diff --git a/src/fence_wrapper.rs b/src/fence_wrapper.rs index fc8f1c2..565f848 100644 --- a/src/fence_wrapper.rs +++ b/src/fence_wrapper.rs @@ -1,7 +1,18 @@ +//! Utilities for wrapping arbitrary input in a Markdown fenced code block. + use std::io::{Read, Write}; use crate::util::fence::generate_outer_backticks; +/// Reads all input, wraps it in a Markdown fenced code block, and writes it to output. +/// +/// The opening fence includes the supplied language tag. If `lang` is empty, the fence is emitted +/// without a language identifier. +/// +/// The fence length is chosen so that any backtick runs inside the input do not accidentally close +/// the outer fence. +/// +/// This function intentionally writes a blank line before the closing fence. pub fn wrap_in_fence( mut input: R, mut output: W, -- cgit v1.3.1