From 730b0a65900c658f2358e0f1da56e036c625d726 Mon Sep 17 00:00:00 2001 From: Haowei Hsu Date: Sun, 4 Jan 2026 00:58:45 +0800 Subject: [PATCH] style(uudoc): update header formatting for options and examples (#10004) Adjust the formatting of the options and examples sections in the uudoc output to use Markdown headers: - Change `

Options

` to `## Options` - Change `Examples` to `## Examples` - Add regression test to prevent reverting to HTML headers --- src/bin/uudoc.rs | 6 ++++-- tests/uudoc/mod.rs | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 5a713e040..392375f9e 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -465,7 +465,9 @@ impl MDWriter<'_, '_> { /// # Errors /// Returns an error if the writer fails. fn options(&mut self) -> io::Result<()> { - writeln!(self.w, "

Options

")?; + writeln!(self.w)?; + writeln!(self.w, "## Options")?; + writeln!(self.w)?; write!(self.w, "
")?; for arg in self.command.get_arguments() { write!(self.w, "
")?; @@ -576,7 +578,7 @@ fn format_examples(content: String, output_markdown: bool) -> ResultOptions"), + "Generated markdown should not contain '

Options

' (use markdown format instead)" + ); + + // Also verify Examples if it exists + if content.contains("## Examples") { + assert!( + content.contains("## Examples"), + "Generated markdown should contain '## Examples' header in markdown format" + ); + } + } +}