aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-10-12 20:30:33 +0100
committerRalph Amissah <ralph@amissah.com>2007-10-12 20:30:33 +0100
commit6acc0270d1323cbdfd4a7c89377cdb7604895d63 (patch)
tree9231eae1a28ca9b0da6558d7adf15c27f7e62b46
parentxml dom extract footnote from grouped text (diff)
special character exceptions, some fixes, primarily underscore
-rw-r--r--CHANGELOG15
-rw-r--r--lib/sisu/v0/html_tune.rb2
-rw-r--r--lib/sisu/v0/manpage.rb4
-rw-r--r--lib/sisu/v0/odf.rb7
-rw-r--r--lib/sisu/v0/plaintext.rb4
-rw-r--r--lib/sisu/v0/shared_html_lite.rb2
-rw-r--r--lib/sisu/v0/shared_xml.rb4
-rw-r--r--lib/sisu/v0/texpdf_format.rb1
8 files changed, 24 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 47a68840..4dd3eccb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -21,9 +21,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.61.0.orig.tar.gz
document, (rather than just e.g. the document title) [affects document
objects and numbering where used, hence version number bump]
- * html, pdf, text object switch off @markup: no_ocn (or command line flag
- --no-ocn), in html objects are still named, (i.e. will still work with
- searches though the relevance of the numbers returned is obscured)
+ * html, pdf, switch text object numbering off, may be set in: (a) document
+ header, @markup: no_ocn; (b) skin (for documents sharing that skin) "def
+ ocn_display_off" and set to true; or (c) as a processing flag "sisu -hpv
+ --no-ocn [filename]". NOTE, now in html objects are still named, (i.e. will
+ still work with searches though the relevance of the numbers returned is
+ obscured)
* shared markup source, composite documents, look to processing directory for
both text (share source) and binary (sisupod (make))
@@ -35,8 +38,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.61.0.orig.tar.gz
dynamic building of some documents)
* sysenv (default) replaced (obsoleted) -A with -a
- * sisu manual, download info, change links to source to archive, rather than
- transient repo
+ * sisu manual, manpage, download info, change links to source to archive,
+ rather than transient repo
+
+ * special character exceptions, some fixes
%% sisu_0.60.1.orig.tar.gz (2007-10-07:40/7)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.60.1.orig.tar.gz
diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb
index b98f19d8..82183a02 100644
--- a/lib/sisu/v0/html_tune.rb
+++ b/lib/sisu/v0/html_tune.rb
@@ -333,7 +333,7 @@ module SiSU_Tune
end
para.gsub!(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/})
end
- else para.gsub!(/_</m,'&lt;'); para.gsub!(/_>/m,'&gt;') #code-block: angle brackets special characters
+ else para.gsub!(/(?=^|[^}])_</m,'&lt;'); para.gsub!(/(?=^|[^}])_>/m,'&gt;') #code-block: angle brackets special characters
end
@tuned_file << para
end
diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb
index 304bcda1..10480b90 100644
--- a/lib/sisu/v0/manpage.rb
+++ b/lib/sisu/v0/manpage.rb
@@ -338,8 +338,8 @@ WOK
para.gsub!(/-/,'\-') #manpages use this
para.gsub!(/&#126;/,'~') 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>/
- para.gsub!(/_</,'<'); para.gsub!(/_>/m,'>') #code-block: angle brackets special characters
+ if para =~/<:code>/ #code-block: angle brackets special characters
+ para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>')
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 610a51aa..171372a9 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -473,8 +473,11 @@ module SiSU_ODF
para=para_array.join(' ')
para=para.strip
end
- para.gsub!(/_</m,'&lt;'); para.gsub!(/_>/m,'&gt;') #code-block: angle brackets special characters
- #para.gsub!(/</,'&lt;'); para.gsub!(/>/,'&gt;')
+ if para =~/<:code>/ #code-block: angle brackets special characters
+ para.gsub!(/(?=^|[^}])_</m,'&lt;'); para.gsub!(/(?=^|[^}])_>/m,'&gt;')
+ end
+ ##para.gsub!(/_</m,'&lt;'); para.gsub!(/([^_])_>/m,'\1&gt;') #code-block: angle brackets special characters
+ #para.gsub!(/_</m,'&lt;'); para.gsub!(/_>/m,'&gt;') #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 c308dfb2..361624e1 100644
--- a/lib/sisu/v0/plaintext.rb
+++ b/lib/sisu/v0/plaintext.rb
@@ -335,8 +335,8 @@ WOK
para.gsub!(/&#169;/,'©')
end
if para =~/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/
- if para =~/<:code>/
- para.gsub!(/_</,'<'); para.gsub!(/_>/m,'>') #code-block: angle brackets special characters
+ if para =~/<:code>/ #code-block: angle brackets special characters
+ para.gsub!(/(?=^|[^}])_</m,'<'); para.gsub!(/(?=^|[^}])_>/m,'>')
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 85368a28..d63f4cef 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -133,7 +133,7 @@ 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,'&lt;'); para.gsub!(/_>/m,'&gt;') #code-block: angle brackets special characters
+ else para.gsub!(/(?=^|[^}])_</m,'&lt;'); para.gsub!(/(?=^|[^}])_>/m,'&gt;') #code-block: angle brackets special characters
end
para
end
diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb
index da1891e5..62e8b5ca 100644
--- a/lib/sisu/v0/shared_xml.rb
+++ b/lib/sisu/v0/shared_xml.rb
@@ -365,7 +365,7 @@ module SiSU_XML_munge
para.gsub!(/&nbsp;/,'&#160;')
#para.gsub!(/&nbsp;/,' ') #clean
else
- para.gsub!(/_</m,'&lt;'); para.gsub!(/_>/m,'&gt;') #code-block: angle brackets special characters
+ para.gsub!(/(?=^|[^}])_</m,'&lt;'); para.gsub!(/(?=^|[^}])_>/m,'&gt;') #code-block: angle brackets special characters
para.gsub!(/&nbsp;/,'&#160;')
end
para
@@ -391,7 +391,7 @@ module SiSU_XML_munge
def markup_group(para='')
para.gsub!(/</,'&lt;'); para.gsub!(/>/,'&gt;')
para.gsub!(/&lt;:?br(?:\s+\/)?&gt;/,'<br />')
- para.gsub!(/&lt;(link xmlns:xlink=".+?)"&gt;/,'<"\1">')
+ para.gsub!(/&lt;(link xmlns:xlink=".+?")&gt;/,'<\1>')
para.gsub!(/&lt;(\/link)&gt;/,'<\1>')
para.gsub!(/&lt;(\/?en)&gt;/,'<\1>')
para
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index bf93ce9c..7798e886 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -519,6 +519,7 @@ WOK
@string.gsub!(/<i>(.+?)<\/i>/,'\emph{\1}')
@string.gsub!(/<italic>(.+?)<\/italic>/,'\emph{\1}')
@string.gsub!(/<u>(.+?)<\/u>/,'\uline{\1}') # ulem
+ @string.gsub!(/<cite>(.+?)<\/cite>/,"``\\1''") # quote
@string.gsub!(/<ins>(.+?)<\/ins>/,'\uline{\1}') # ulem
@string.gsub!(/<del>(.+?)<\/del>/,'\sout{\1}') # ulem
@string.gsub!(/<sub>(.+?)<\/sub>/,"\$_{\\textrm{\\1}}\$")