diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/html_tune.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/manpage.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/odf.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v0/plaintext.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v0/shared_html_lite.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/shared_xml.rb | 3 |
6 files changed, 15 insertions, 8 deletions
diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb index 82183a02..ab37abb2 100644 --- a/lib/sisu/v0/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -333,7 +333,9 @@ module SiSU_Tune end para.gsub!(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/}) end - else para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') #code-block: angle brackets special characters + else + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') #code-block: angle brackets special characters + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') end @tuned_file << para end diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 10480b90..8de98bde 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -339,7 +339,9 @@ WOK para.gsub!(/~/,'~') if para #manpages use this if para =~/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/ if para =~/<:code>/ #code-block: angle brackets special characters - para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') + para.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _> _< + para.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _<_< + #para.gsub!(/(?![}])_([<>])/m,'\1') # _> _< }_< end para.gsub!(/<br(?: \/)?>/,"\n\n.P\n\n") # watch para.gsub!(/<:(?:group|verse|alt)(?:\\-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/,'') diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 171372a9..4884c33a 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -474,10 +474,9 @@ module SiSU_ODF para=para.strip end if para =~/<:code>/ #code-block: angle brackets special characters - para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') end - ##para.gsub!(/_</m,'<'); para.gsub!(/([^_])_>/m,'\1>') #code-block: angle brackets special characters - #para.gsub!(/_</m,'<'); para.gsub!(/_>/m,'>') #code-block: angle brackets special characters para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.22cm" svg:height="0.22cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_09.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_09.png #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<text:span text:style-name="T6">●</text:span> ') #bullet #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1● ') # bullet utf8, make smaller if used diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index 361624e1..d6284613 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -336,7 +336,8 @@ WOK end if para =~/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/ if para =~/<:code>/ #code-block: angle brackets special characters - para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') + para.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _> _< + para.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _<_< end para.gsub!(/<br(?: \/)?>/,"\n") # watch para.gsub!(/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/,'') diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb index d63f4cef..730bf00d 100644 --- a/lib/sisu/v0/shared_html_lite.rb +++ b/lib/sisu/v0/shared_html_lite.rb @@ -133,7 +133,9 @@ module SiSU_Format_Shared para.gsub!(/\b[_\\]((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'<a href="\1" target="_top">\1</a>\2') #http ftp matches escaped, no decoration para.gsub!(/((?:^|\s)[}])((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #special case \{ e.g. \}http://url para.gsub!(/(^|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration - else para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') #code-block: angle brackets special characters + else + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') #code-block: angle brackets special characters + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') end para end diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index 62e8b5ca..7f9cdc83 100644 --- a/lib/sisu/v0/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -365,7 +365,8 @@ module SiSU_XML_munge para.gsub!(/ /,' ') #para.gsub!(/ /,' ') #clean else - para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>') #code-block: angle brackets special characters + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') #code-block: angle brackets special characters + para.gsub!(/(^|[^}])_</m,'\1<'); para.gsub!(/(^|[^}])_>/m,'\1>') para.gsub!(/ /,' ') end para |