From 341e92ed99e198e009751a0619fda9ce4d16a009 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 13:46:15 +0100 Subject: manpage, special character fixes --- lib/sisu/v0/manpage.rb | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 05586dec..5b2cef6f 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -187,6 +187,8 @@ module SiSU_manpage end wrap=util.line_wrap if wrap =~ /^\s*[\d*+]+\s+.+?\s*\Z/m + wrap.gsub!(/(^| |\s|\*)\\\*/,'\1\\\\\*') #man page requires + wrap.gsub!(/\s\.(\S+)/,' \\.\1') wrap.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape wrap.gsub!(/^\s*([\d*+]+)\s+(.+?)\s*\Z/m, <(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/ @@ -370,10 +364,9 @@ WOK para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') # remove empty lines - check para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\2\3') para.gsub!(/(.+?)<\/a>/m,'\1') - para.gsub!(/<:name#\S+?>/,'') # remove name links - para.gsub!(/ /,' ') # decide on - para.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape - #para.gsub!(/(["''])/,"\\\\\\1") # decide on + para.gsub!(/<:name#\S+?>/,'') # remove name links + para.gsub!(/ /,' ') # decide on + para.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]") para.gsub!(/^\{\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]') wordlist=para.scan(/\S+/) @@ -508,7 +501,7 @@ WOK line.gsub!(/\s+$/m,'') filename_manpage.puts line #unix manpage end - else filename_manpage.puts para #unix manpage # /^([*=-]|\.){5}/ + else filename_manpage.puts para #unix manpage # /^([*=-]|\.){5}/ end end filename_manpage.close -- cgit v1.2.3