Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mandown for openSUSE:Factory checked in at 2026-09-18 22:09:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mandown (Old) and /work/SRC/openSUSE:Factory/.mandown.new.383539 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mandown" Fri Sep 18 22:09:10 2026 rev:5 rq:1378862 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/mandown/mandown.changes 2026-04-21 12:46:37.506915175 +0200 +++ /work/SRC/openSUSE:Factory/.mandown.new.383539/mandown.changes 2026-09-18 22:09:24.469808543 +0200 @@ -1,0 +2,11 @@ +Sun Sep 13 12:03:37 UTC 2026 - Martin Pluskal <[email protected]> + +- Update to 1.1.1: + * Escape backslashes and line-leading apostrophes in text + * Fix stdin input ignoring the title argument + * Replace mdoc .Bl/.El with man .IP list macros + * Build with edition 2024 +- Run upstream unit tests in %check +- Spec cleanup: drop obsolete Group tag + +------------------------------------------------------------------- Old: ---- mandown-1.1.0.tar.zst New: ---- mandown-1.1.1.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mandown.spec ++++++ --- /var/tmp/diff_new_pack.s1AzRW/_old 2026-09-18 22:09:25.210839599 +0200 +++ /var/tmp/diff_new_pack.s1AzRW/_new 2026-09-18 22:09:25.212839683 +0200 @@ -17,11 +17,10 @@ Name: mandown -Version: 1.1.0 +Version: 1.1.1 Release: 0 Summary: A man page generator for markdown markup files License: Apache-2.0 -Group: Development/Tools/Doc Generators URL: https://gitlab.com/kornelski/mandown Source0: %{name}-%{version}.tar.zst Source1: vendor.tar.zst @@ -40,7 +39,10 @@ %{cargo_build} %install -%{cargo_install} +%cargo_install + +%check +%{cargo_test} %files %license LICENSE ++++++ _service ++++++ --- /var/tmp/diff_new_pack.s1AzRW/_old 2026-09-18 22:09:25.249841234 +0200 +++ /var/tmp/diff_new_pack.s1AzRW/_new 2026-09-18 22:09:25.251841318 +0200 @@ -3,7 +3,7 @@ <param name="url">https://gitlab.com/kornelski/mandown.git</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v1.1.0</param> + <param name="revision">v1.1.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> </service> @@ -11,7 +11,7 @@ <param name="basename">mandown</param> </service> <service name="recomprizz" mode="manual"> - <param name="target">mandown-1.1.0.tar</param> + <param name="target">mandown-1.1.1.tar</param> </service> <service name="cargo_vendor" mode="manual"> <param name="srcdir">mandown</param> ++++++ mandown-1.1.0.tar.zst -> mandown-1.1.1.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mandown-1.1.0/Cargo.lock new/mandown-1.1.1/Cargo.lock --- old/mandown-1.1.0/Cargo.lock 2026-04-20 23:29:30.000000000 +0200 +++ new/mandown-1.1.1/Cargo.lock 2026-09-13 14:03:16.000000000 +0200 @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "bitflags" @@ -25,7 +25,7 @@ [[package]] name = "mandown" -version = "1.1.0" +version = "1.1.1" dependencies = [ "deunicode", "pulldown-cmark", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mandown-1.1.0/Cargo.toml new/mandown-1.1.1/Cargo.toml --- old/mandown-1.1.0/Cargo.toml 2026-04-20 23:29:30.000000000 +0200 +++ new/mandown-1.1.1/Cargo.toml 2026-09-13 14:03:16.000000000 +0200 @@ -1,8 +1,8 @@ [package] name = "mandown" -version = "1.1.0" +version = "1.1.1" authors = ["Kornel <[email protected]>"] -edition = "2021" +edition = "2024" description = "Markdown to groff (man page) converter" license = "Apache-2.0 OR MIT" include = ["/Cargo.toml", "README.md", "/src/*.rs"] @@ -11,7 +11,6 @@ keywords = ["markdown", "manpage", "roff", "troff", "groff"] categories = ["text-processing", "command-line-utilities"] repository = "https://gitlab.com/kornelski/mandown.git" -rust-version = "1.74" [dependencies] pulldown-cmark = "0.13" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mandown-1.1.0/src/lib.rs new/mandown-1.1.1/src/lib.rs --- old/mandown-1.1.0/src/lib.rs 2026-04-20 23:29:30.000000000 +0200 +++ new/mandown-1.1.1/src/lib.rs 2026-09-13 14:03:16.000000000 +0200 @@ -54,7 +54,7 @@ Rule => { html_state.reset(); links.flush(&mut out, false); - out.centered("----") + out.centered("----"); }, Html(markup) | DisplayMath(markup) => { out.ensure_line_start(); @@ -75,8 +75,8 @@ } out.section_title_start(n + 1 - min_header_level); }, - End(TagEnd::Heading(n)) => { - out.section_title_end((n as u32) + 1 - min_header_level); + End(TagEnd::Heading(_)) => { + out.section_title_end(); links.flush(&mut out, false); }, @@ -117,14 +117,14 @@ } } } - let id = if !id.is_empty() { id } else { + let id = if id.is_empty() { link_ref_num += 1; format!("{}{link_ref_num}", if is_image { "img" } else { "" }).into() - }; - if !shortcut_reference { - out.text(&format!("[{id}]")); - } else { + } else { id }; + if shortcut_reference { out.text("]"); + } else { + out.text(&format!("[{id}]")); } if !matches_existing { @@ -160,7 +160,6 @@ End(TagEnd::Item) => { in_list = false; first_para_in_list = false; - out.list_item_end(); }, Start(BlockQuote(kind)) => { @@ -246,8 +245,8 @@ out.table_start(); }, End(TagEnd::Table) => out.table_end(), - Start(TableRow) | Start(TableHead) => out.table_row_start(), - End(TagEnd::TableRow) | End(TagEnd::TableHead) => out.table_row_end(), + Start(TableRow | TableHead) => out.table_row_start(), + End(TagEnd::TableRow | TagEnd::TableHead) => out.table_row_end(), Start(TableCell) => out.table_cell_start(), End(TagEnd::TableCell) => out.table_cell_end(), @@ -293,7 +292,7 @@ for (url, title, id) in self.deferred.drain(..).chain(self.regular.drain(..)) { out.text(&format!("[{id}]: {url}")); if !title.is_empty() { - out.text(&format!(" {title}")) + out.text(&format!(" {title}")); } out.line_break(); } @@ -331,7 +330,7 @@ } } - pub fn section_title_end(&mut self, _level: u32) { + pub fn section_title_end(&mut self) { self.in_quotes = false; self.out.push_str("\"\n"); } @@ -355,7 +354,7 @@ self.unclosed_table_cell = false; self.text("\t|"); } - self.line_break() + self.line_break(); } pub fn table_cell_start(&mut self) { @@ -391,19 +390,12 @@ pub fn list_item_start(&mut self, n: Option<u64>) { self.ensure_line_start(); - self.out.push_str(".Bl\n"); - if let Some(n) = n { - self.out.push_str(&format!(".IP {n}. 4\n")); - } else { - self.out.push_str(".IP \\(bu 4\n"); + match n { + Some(n) => self.out.push_str(&format!(".IP {n}. 4\n")), + None => self.out.push_str(".IP \\(bu 4\n"), } } - pub fn list_item_end(&mut self) { - self.ensure_line_start(); - self.out.push_str(".El\n"); - } - pub fn ensure_line_start(&mut self) { if self.out.is_empty() || self.out.ends_with('\n') { return; @@ -414,9 +406,19 @@ pub fn text(&mut self, text: &str) { let text = deunicode::deunicode_with_tofu_cow(text, "[?]"); let text = if self.in_quotes { - text.replace('"', "\"\"") + text.replace('\\', "\\e").replace('"', "\"\"") } else { - text.replace('-', "\\-").replace('.', "\\.") + // Escape backslashes first, so the escapes added below aren't re-escaped. + let text = text.replace('\\', "\\e").replace('-', "\\-").replace('.', "\\."); + // A `'` at the start of a groff line is a control character, and the + // line would be dropped as an unknown request. Neutralize it. + let text = text.replace("\n'", "\n\\&'"); + let at_line_start = self.out.is_empty() || self.out.ends_with('\n'); + if at_line_start && text.starts_with('\'') { + format!("\\&{text}") + } else { + text + } }; self.out.push_str(&text); } @@ -589,3 +591,30 @@ }; assert_eq!("hi c X aaa 1 <> 2 end", t.strip_tags("<x>hi</x> <!-- com -->c<!--> X<x/> <a href=''>aaa</a> 1 <> 2 <script> garbage <!--> </script>end")); } + +#[test] +fn groff_escaping() { + let out = convert("'quote\n\n\\backslash and don't\n", "T", 1); + assert!( + out.contains("\\&'quote"), + "apostrophe at the start of a line must be neutralized, got:\n{out}" + ); + assert!( + out.contains("\\ebackslash"), + "backslash must be escaped, got:\n{out}" + ); + assert!( + out.contains("don't"), + "mid-line apostrophe must stay literal, got:\n{out}" + ); +} + +#[test] +fn lists_use_man_ip_macros() { + let out = convert("- a\n- b\n\n1. one\n2. two\n", "T", 1); + assert!(!out.contains(".Bl"), "mdoc .Bl must not be emitted: {out}"); + assert!(!out.contains(".El"), "mdoc .El must not be emitted: {out}"); + assert!(out.contains(".IP \\(bu 4"), "bullet items need .IP: {out}"); + assert!(out.contains(".IP 1. 4"), "numbered items need .IP: {out}"); + assert!(out.contains(".IP 2. 4"), "numbered items need .IP: {out}"); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mandown-1.1.0/src/main.rs new/mandown-1.1.1/src/main.rs --- old/mandown-1.1.0/src/main.rs 2026-04-20 23:29:30.000000000 +0200 +++ new/mandown-1.1.1/src/main.rs 2026-09-13 14:03:16.000000000 +0200 @@ -30,7 +30,7 @@ Some(path) if path == "-" => { let mut s = String::new(); std::io::stdin().read_to_string(&mut s)?; - (s, None) + (s, title.as_deref()) }, _ => { println!("Usage: {prog} path-to-markdown.md [title] [manpage section]\n"); ++++++ vendor.tar.zst ++++++ ++++ 116396 lines of diff (skipped)
