diff options
Diffstat (limited to 'lib/sisu/v5')
-rw-r--r-- | lib/sisu/v5/css.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v5/dal_doc_str.rb | 65 | ||||
-rw-r--r-- | lib/sisu/v5/dal_expand_insertions.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v5/dal_misc_arrange.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v5/dal_syntax.rb | 46 | ||||
-rw-r--r-- | lib/sisu/v5/epub_format.rb | 4 |
6 files changed, 67 insertions, 68 deletions
diff --git a/lib/sisu/v5/css.rb b/lib/sisu/v5/css.rb index b6aacaa8..8d02f20d 100644 --- a/lib/sisu/v5/css.rb +++ b/lib/sisu/v5/css.rb @@ -449,8 +449,8 @@ WOK margin-left: 0em; margin-right: 2em; text-indent: 0mm; - margin-top: 4px; - margin-bottom: 4px; + margin-top: 0.8em; + margin-bottom: 0.8em; } /* indent */ diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index ebde930a..d3f65bff 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -72,7 +72,6 @@ module SiSU_DAL_DocumentStructureExtract table_to: :off, } def initialize - @@flag[:table_to]=:off @@counter=@@column=@@columns=0 @@line_mode='' end @@ -195,7 +194,7 @@ module SiSU_DAL_DocumentStructureExtract end t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") if @@flag[:code]==:off if t_o !~/^(?:code|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\{|\{table)[ ~]/ \ - and t_o !~/^```\s+(?:code|poem|alt|group|block)|^```(?:\s*[~-][#])?\s*$/ \ + and t_o !~/^[`]{3}\s+(?:code|poem|alt|group|block)|^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/ \ and @@flag[:code]==:off \ and @@flag[:poem]==:off \ and @@flag[:group]==:off \ @@ -346,48 +345,48 @@ module SiSU_DAL_DocumentStructureExtract end end elsif @@flag[:code]==:off - if t_o =~/^(?:code\{|```\s+code)/ + if t_o =~/^(?:code\{|[`]{3}\s+code)/ @@flag[:code]=case t_o - when /^code\{/; :curls - when /^```\s+code/; :tics - else @@flag[:code] #error + when /^code\{/; :curls + when /^[`]{3}\s+code/; :tics + else @@flag[:code] #error end @@counter=1 - @codeblock_numbered=(t_o =~/^(?:code\{#|```\s+code\s[#])/) ? true : false + @codeblock_numbered=(t_o =~/^(?:code\{#|[`]{3}\s+code\s[#])/) ? true : false h={ obj: 'code block start' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) - elsif t_o =~/^(?:poem\{|```\s+poem)/ + elsif t_o =~/^(?:poem\{|[`]{3}\s+poem)/ @@flag[:poem]=case t_o - when /^poem\{/; :curls - when /^```\s+poem/; :tics - else @@flag[:poem] #error + when /^poem\{/; :curls + when /^[`]{3}\s+poem/; :tics + else @@flag[:poem] #error end h={ obj: 'poem start' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^(?:group\{|```\s+group)/ + elsif t_o =~/^(?:group\{|[`]{3}\s+group)/ @@flag[:group]=case t_o - when /^group\{/; :curls - when /^```\s+group/; :tics - else @@flag[:group] #error + when /^group\{/; :curls + when /^[`]{3}\s+group/; :tics + else @@flag[:group] #error end h={ obj: 'group text start' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^(?:block\{|```\s+block)/ + elsif t_o =~/^(?:block\{|[`]{3}\s+block)/ @@flag[:block]=case t_o - when /^block\{/; :curls - when /^```\s+block/; :tics - else @@flag[:block] #error + when /^block\{/; :curls + when /^[`]{3}\s+block/; :tics + else @@flag[:block] #error end h={ obj: 'block text start' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^(?:alt\{|```\s+alt)/ + elsif t_o =~/^(?:alt\{|[`]{3}\s+alt)/ @@flag[:alt]=case t_o - when /^alt\{/; :curls - when /^```\s+alt/; :tics - else @@flag[:alt] #error + when /^alt\{/; :curls + when /^[`]{3}\s+alt/; :tics + else @@flag[:alt] #error end h={ obj: 'alt text start' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) @@ -410,7 +409,7 @@ module SiSU_DAL_DocumentStructureExtract heading=false end @h={ head_: heading, cols: cols, widths: col, idx: idx } - elsif t_o=~/^```\s+table(?:~h)?\s+/ + elsif t_o=~/^[`]{3}\s+table(?:~h)?\s+/ @@flag[:table]=:tics @rows='' case t_o @@ -484,7 +483,7 @@ module SiSU_DAL_DocumentStructureExtract if (@@flag[:table]==:curls \ and t_o =~/^\}table/) \ or (@@flag[:table]==:tics \ - and t_o =~/^```(?:\s*[~-][#])?\s*$/) + and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:table]=:off headings,columns,widths,idx=@h[:head_],@h[:cols],@h[:widths],@h[:idx] @h={ head_: headings, cols: columns, widths: widths, idx: idx, obj: @rows } @@ -496,7 +495,7 @@ module SiSU_DAL_DocumentStructureExtract t_o else if t_o.is_a?(String) \ - and t_o !~/^(?:table\{|```\s+table)/ + and t_o !~/^(?:table\{|[`]{3}\s+table)/ t_o=t_o.gsub(/^\n+/m,''). #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2) gsub(/\n+/m,"#{Mx[:tc_p]}") @rows += t_o + Mx[:tc_c] @@ -506,7 +505,7 @@ module SiSU_DAL_DocumentStructureExtract end if @@flag[:code]==:curls or @@flag[:code]==:tics if (@@flag[:code]==:curls and t_o =~/^\}code/) \ - or (@@flag[:code]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + or (@@flag[:code]==:tics and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:code]=:off obj=@tuned_code.join("\n") tags=[] @@ -531,12 +530,12 @@ module SiSU_DAL_DocumentStructureExtract or (@@flag[:block]==:curls or @@flag[:block]==:tics) \ or (@@flag[:alt]==:curls or @@flag[:alt]==:tics) if (@@flag[:poem]==:curls and t_o =~/^\}poem/) \ - or (@@flag[:poem]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + or (@@flag[:poem]==:tics and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:poem]=:off h={ obj: 'poem end' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) elsif (@@flag[:group]==:curls and t_o =~/^\}group/) \ - or (@@flag[:group]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + or (@@flag[:group]==:tics and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:group]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } @@ -546,7 +545,7 @@ module SiSU_DAL_DocumentStructureExtract h={ obj: 'group text end' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) elsif (@@flag[:block]==:curls and t_o =~/^\}block/) \ - or (@@flag[:block]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + or (@@flag[:block]==:tics and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:block]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } @@ -556,7 +555,7 @@ module SiSU_DAL_DocumentStructureExtract h={ obj: 'block text end' } #introduce a counter t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) elsif (@@flag[:alt]==:curls and t_o =~/^\}alt/) \ - or (@@flag[:alt]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + or (@@flag[:alt]==:tics and t_o =~/^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) @@flag[:alt]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } @@ -571,7 +570,7 @@ module SiSU_DAL_DocumentStructureExtract or @@flag[:alt]==:curls or @@flag[:alt]==:tics) \ and t_o =~/\S/ \ and t_o !~/^(?:\}(?:verse|code|alt|group|block)|(?:verse|code|alt|group|block)\{)/ \ - and t_o !~/^```\s+(?:code|poem|alt|group|block)|^```(?:\s*[~-][#])?\s*$/ # fix logic + and t_o !~/^[`]{3}\s+(?:code|poem|alt|group|block)|^[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/ # fix logic sub_array=t_o.dup @line_mode=sub_array.scan(/.+/) type=if @@flag[:poem]==:curls or @@flag[:poem]==:tics @@ -659,7 +658,7 @@ module SiSU_DAL_DocumentStructureExtract lines.each do |line| line=if line =~/\S/ \ and line !~/^(?:code\{|\}code)/ \ - and line !~/^(?:```\s+code|```(?:\s*[~-][#])?\s*$)/ \ + and line !~/^(?:[`]{3}\s+code|[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$)/ \ and not line.is_a?(Hash) #watch @@counter+=1 if @@flag[:code]==:curls or @@flag[:code]==:tics line=line.gsub(/\s\s/,"#{Mx[:nbsp]*2}"). diff --git a/lib/sisu/v5/dal_expand_insertions.rb b/lib/sisu/v5/dal_expand_insertions.rb index eb4f8363..e43dd3af 100644 --- a/lib/sisu/v5/dal_expand_insertions.rb +++ b/lib/sisu/v5/dal_expand_insertions.rb @@ -332,9 +332,9 @@ module SiSU_DAL_Insertions tuned_file,tuned_file_tmp=[],[] codeblock_=false data.each do |para| - codeblock_=if para =~/^(?:code\{|```\s+code)/ + codeblock_=if para =~/^(?:code\{|[`]{3}\s+code)/ true - elsif para =~/^(?:\}code|```)/m + elsif para =~/^(?:\}code|[`]{3}(?:\s|$))/m false else codeblock_ end diff --git a/lib/sisu/v5/dal_misc_arrange.rb b/lib/sisu/v5/dal_misc_arrange.rb index c1751360..ab4f3ea4 100644 --- a/lib/sisu/v5/dal_misc_arrange.rb +++ b/lib/sisu/v5/dal_misc_arrange.rb @@ -76,20 +76,20 @@ module SiSU_DAL_MiscArrangeText def code_blocks(para) def ticks(para) block_open,block_close,text=nil,nil,nil - if para =~/\A(``` .+?)\n(.+?)\n(```(?: [~-][#])?)\s*\Z/m - block_open,text,block_close=/\A(``` .+?)\n(.+?)\n(```(?: [~-][#])?)\s*\Z/m.match(para)[1..3] + if para =~/\A[`]{3}\s+.+?\n.+?\n[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*\Z/m + block_open,text,block_close=/\A([`]{3}\s+.+?)\n(.+?)\n([`]{3}(\s+[~-][#]|\s+\~\{.+?\}\~)?)\s*\Z/m.match(para)[1..3] para=[] para << block_open << text << block_close - elsif para =~/\A(``` .+?)\n(.*?)\Z/m #look at, study - block_open,text=/\A(```(?: .+?))\n(.*?)\Z/m.match(para)[1,2] + elsif para =~/\A[`]{3}\s+.+?\n.*?\Z/m #look at, study + block_open,text=/\A([`]{3}(?:\s+.+?))\n(.*?)\Z/m.match(para)[1,2] para=[] if not text.to_s.empty? para << block_open << text else para << block_open end - elsif para =~/\A(.+?)\n(```(?:\s*[~-][#])?)\s*\Z/m - text,block_close=/\A(.+?)\n(```(?: [~-][#])?)\s*\Z/m.match(para)[1,2] + elsif para =~/\A.+?\n[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*\Z/m + text,block_close=/\A(.+?)\n([`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?)\s*\Z/m.match(para)[1,2] para=[] if not text.to_s.empty? para << text.to_s << block_close diff --git a/lib/sisu/v5/dal_syntax.rb b/lib/sisu/v5/dal_syntax.rb index 08b7f6a9..7852ab85 100644 --- a/lib/sisu/v5/dal_syntax.rb +++ b/lib/sisu/v5/dal_syntax.rb @@ -309,17 +309,17 @@ module SiSU_DAL_Syntax dob end def fontface(dob) - dob.obj=dob.obj.gsub(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx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c]}"). #cite /blockquote? gsub(/(^|[^\\])\^\{(.+?)\}\^/m, "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}"). #superscript @@ -444,7 +444,7 @@ module SiSU_DAL_Syntax "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4 #{Mx[:en_a_o]}\\3#{Mx[:en_a_c]} ") end dob.obj=dob.obj.gsub(/(^|[^#])\{\s*([^{}]+?)\s*\}((?:https?:|:|[.]{2}\/|#)\S+?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/, - "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3"). #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) + "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3"). #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) gsub(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3}). gsub(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([()\[\]]*[,.;:!?'"]{0,2})(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, @@ -462,40 +462,40 @@ module SiSU_DAL_Syntax dob.obj=dob.obj.gsub(/<[:e]\s+(.+?)!?>/, "#{Mx[:en_a_o]}\\1#{Mx[:en_a_c]}"). #not tested gsub(/(^|#{Mx[:br_nl]})\s*_\*\s*/, - "\\1#{Mx[:gl_bullet]}"). #bullets, shortcut + "\\1#{Mx[:gl_bullet]}"). #bullets, shortcut gsub(/=\{(.+?)\}/, "#{Mx[:idx_o]}\\1#{Mx[:idx_c]}"). gsub(/^\s*_([1-9])\*\s*/, - "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}"). #bullets, shortcut + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}"). #bullets, shortcut gsub(/^\s*_([1-9])\s+/, - "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}"). #indent + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}"). #indent gsub(/^\s*_([1-9])!\s+(.+?)\s*$/, - "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} "). #indent bold + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} "). #indent bold gsub(/^\s*__([1-9])\s+/, - "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}"). #hang + "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}"). #hang gsub(/^\s*__([1-9])!\s+(.+?)\s*$/, - "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} "). #hangdef + "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} "). #hangdef gsub(/^\s*_([0-9])_([0-9])\s+/, - "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}"). #hang + "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}"). #hang gsub(/^\s*_([0-9])_([0-9])!\s+(.+?)\s*$/, - "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\3#{Mx[:fa_bold_c]} "). #hangdef - gsub(/<:hi>/,"#{Mx[:fa_hilite_o]}"). #'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) - gsub(/<:\/hi>/,"#{Mx[:fa_hilite_c]}"). #'</span>') + "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\3#{Mx[:fa_bold_c]} "). #hangdef + gsub(/<:hi>/,"#{Mx[:fa_hilite_o]}"). #'<span style="background-color: rgb(255,240,196)">'). # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) + gsub(/<:\/hi>/,"#{Mx[:fa_hilite_c]}"). #'</span>'). gsub(/(#{Mx[:gr_o]}verse#{Mx[:gr_c]}.+)/m,"\\1\n"). gsub(/[ ]+($)/,'\1'). gsub(/\{\s*(.+?)\s*\}(https?:\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/, - "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3"). #any remaining linked text or image + "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3"). #any remaining linked text or image gsub(/\{\s*(.+?)\s*\}(#{Mx[:url_o]}\S+?#{Mx[:url_c]})/, - "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2"). #any remaining linked text or image + "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2"). #any remaining linked text or image gsub(/(^|\s)([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,"\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}"). gsub(/(^|[ ])\{\s*(.+?)\s*\}(\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/, - "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4"). #any remaining linked text or image + "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4"). #any remaining linked text or image gsub(/\{\s*(.+?)\s*\}#([a-zA-Z0-9][a-zA-Z0-9_-]*)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/, - "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:rel_o]}\\2#{Mx[:rel_c]}\\3"). #any remaining linked text or image, check need + "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:rel_o]}\\2#{Mx[:rel_c]}\\3"). #any remaining linked text or image, check need gsub(/\{\s*(.+?)\s*\}(#{Mx[:rel_o]}\S+?#{Mx[:rel_c]})/, - "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2"). #any remaining linked text or image, check need + "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2"). #any remaining linked text or image, check need gsub(/\{\s*(.+?)\s*\}(image)/, - "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #linked image + "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #linked image elsif dob.is==:table dob=fontface(dob) elsif dob.is ==:code diff --git a/lib/sisu/v5/epub_format.rb b/lib/sisu/v5/epub_format.rb index 2ac7a91a..513e1dd2 100644 --- a/lib/sisu/v5/epub_format.rb +++ b/lib/sisu/v5/epub_format.rb @@ -171,8 +171,8 @@ module SiSU_EPUB_Format margin-left: 0em; margin-right: 2em; text-indent: 0mm; - margin-top: 4px; - margin-bottom: 4px; + margin-top: 0.8em; + margin-bottom: 0.8em; } p.norm { } p.i1 {padding-left: 1em;} |