From: Thomas Weißschuh Date: Fri, 12 May 2023 08:00:34 +0000 (+0200) Subject: po-man: add warning for replaced unicode dashes X-Git-Tag: v2.39~17^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3dec59f282bce8960129d5fe918843682a5e037;p=thirdparty%2Futil-linux.git po-man: add warning for replaced unicode dashes Signed-off-by: Thomas Weißschuh --- diff --git a/tools/asciidoctor-unicodeconverter.rb b/tools/asciidoctor-unicodeconverter.rb index 759307acce..4983ee5c64 100644 --- a/tools/asciidoctor-unicodeconverter.rb +++ b/tools/asciidoctor-unicodeconverter.rb @@ -15,8 +15,10 @@ module UnicodeConverter command = document.attributes['docname'].rpartition('.')[0] lines.map! do |line| if state == IN_NAME_SECTION - line.sub! " \u2013 ", " - " - line.sub! " \u2014 ", " - " + if line.sub! " \u2013 ", " - " or line.sub! " \u2014 ", " - " + logger.warn "replacing unicode dash in name section of #{document.attributes['docfile']}" + end + if line.start_with? command and not line.include? ',' and not line.start_with? "#{command} - " logger.warn "adding dash to name section of #{document.attributes['docfile']}" line.sub! command, "#{command} - "