diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-07-26 20:34:37 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-07-26 20:34:37 -0400 |
commit | d613c9786784d6ff948d11dc248564ccca6ed469 (patch) | |
tree | 482fb7de49868c39001228afe8bd65d70dfcca63 /lib | |
parent | v3: odf, manpage, "new" indent not implemented (diff) |
v3: po4a, indent (check for breakage)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3/po4a.rb | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index dd2aff7a..c87da346 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -498,8 +498,8 @@ GSUB #puts z unless z.empty? end end - def pot_structure(desc,orig,trans,indent=0) - SiSU_po4a_utils::Wrap.new(@md,orig,trans,desc,@wrap_width,indent) + def pot_structure(desc,orig,trans,indent=0,hang=0) + SiSU_po4a_utils::Wrap.new(@md,orig,trans,desc,@wrap_width,indent,hang) end def pot_structure_heading(dob_src='',notes_s='',dob_trn='',notes_t='') #% Used to extract the structure of a document lv=n=n3=nil @@ -533,7 +533,8 @@ GSUB end def pot_structure_para(dob_src='',notes_s='',dob_trn='',notes_t='') #% Used to extract the structure of a document util=nil - wrapped=if dob_src.indent =~/[1-9]/ + wrapped=if dob_src.indent =~/[1-9]/ \ + and dob_src.indent == dob_src.hang s_mark=desc=orig=trans='' if dob_src.bullet_ mark="_#{dob_src.indent}* " @@ -557,6 +558,20 @@ GSUB orig="#{s_mark}#{dob_src.obj}" trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}" util=pot_structure(desc,orig,trans) + elsif dob_src.hang =~/[0-9]/ \ + and dob_src.indent != dob_src.hang + s_mark=desc=orig=trans='' + mark="_#{dob_src.hang}_#{dob_src.indent} " + d="#{dob_src.is}: hang #{dob_src.hang} indent #{dob_src.indent}" + instruct=s_mark='' + if @md.opt.cmd=~/M/ + instruct=%{\n# markup for indented text with a first line indented to a different level from the rest of the paragraph, is at the start of the line/object, an underscore and the first indent level a second underscore and the indent level for the rest of the paragraph, "#{mark1}"} + s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} + end + desc="#{d}#{s_mark}#{instruct}" + orig="#{s_mark}#{dob_src.obj}" + trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}" + util=pot_structure(desc,orig,trans) else s_mark=desc=orig=trans='' if dob_src.bullet_ |