]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
po-man: add warning for replaced unicode dashes
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 12 May 2023 08:00:34 +0000 (10:00 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 12 May 2023 08:00:49 +0000 (10:00 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tools/asciidoctor-unicodeconverter.rb

index 759307acce0924ea62cd0f45d8d6ca6a5a9f1763..4983ee5c6455bba3b49e14747ef4c1fd031dc287 100644 (file)
@@ -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} - "