From 3dfeaa3c41d8fa07e677942e357637c88c4db3a2 Mon Sep 17 00:00:00 2001 From: Haowei Hsu Date: Sat, 3 Jan 2026 21:19:57 +0800 Subject: [PATCH] style(uudoc): update header formatting for options and examples 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 5a713e040fa..392375f9edb 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" + ); + } + } +}