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"
+ );
+ }
+ }
+}