diff options
| author | Ralph Amissah <ralph@amissah.com> | 2014-08-20 18:45:06 -0400 | 
|---|---|---|
| committer | Ralph Amissah <ralph@amissah.com> | 2014-08-20 18:45:06 -0400 | 
| commit | 0fda4e964a07556aa2de453b841eba46524b84b5 (patch) | |
| tree | b1e57f1432272f98757d58630228d24eedd266b1 | |
| parent | v5 v6: texpdf, output, copyright & license (diff) | |
v5 v6: ao_expand_insertions, blocked text match, adjust
| -rw-r--r-- | data/doc/sisu/CHANGELOG_v5 | 2 | ||||
| -rw-r--r-- | data/doc/sisu/CHANGELOG_v6 | 2 | ||||
| -rw-r--r-- | lib/sisu/v5/ao_expand_insertions.rb | 35 | ||||
| -rw-r--r-- | lib/sisu/v6/ao_expand_insertions.rb | 35 | 
4 files changed, 62 insertions, 12 deletions
| diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index f0bc0f4b..bd4cd945 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.2.orig.tar.xz    sisu_5.6.2.orig.tar.xz    sisu_5.6.2-1.dsc +* ao_expand_insertions, blocked text match, adjust +  * texpdf, output, copyright & license  * syntax hilighting, restrict heading matches, minor diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 82c7d074..f7d7997d 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.3.orig.tar.xz    sisu_6.2.3.orig.tar.xz    sisu_6.2.3-1.dsc +* ao_expand_insertions, blocked text match, adjust +  * texpdf, output, copyright & license  * syntax hilighting, restrict heading matches, minor diff --git a/lib/sisu/v5/ao_expand_insertions.rb b/lib/sisu/v5/ao_expand_insertions.rb index be326a7a..483e9fdb 100644 --- a/lib/sisu/v5/ao_expand_insertions.rb +++ b/lib/sisu/v5/ao_expand_insertions.rb @@ -356,16 +356,39 @@ module SiSU_AO_Insertions      def expand_insertions?        data=@data        tuned_file,tuned_file_tmp=[],[] -      codeblock_=false +      codeblock_={ +        status: :false, +        type:   :na, +      }        data.each do |para| -        codeblock_=if para =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/ -          true -        elsif para =~/^(?:\}code|```(?:\s|$))/m -          false +        codeblock_=if para =~/^code(?:\.[a-z][0-9a-z_]+)?\{/ \ +        and codeblock_[:status]==:false +          { +            status: :true, +            type:   :curl, +          } +        elsif para =~/^```[ ]+code(?:\.[a-z][0-9a-z_]+)?/ \ +        and codeblock_[:status]==:false +          { +            status: :true, +            type:   :tics, +          } +        elsif codeblock_[:type]==:curl \ +        and para =~/^\}code/m +          { +            status: :false, +            type:   :na, +          } +        elsif codeblock_[:type]==:tics \ +        and para =~/^```(?:\s|$)/m +          { +            status: :false, +            type:   :na, +          }          else codeblock_          end          if para !~/^%+\s/ \ -        and not codeblock_ \ +        and codeblock_[:status] != :true \          and para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/            @u=SiSU_Env::InfoEnv.new.url            m_cmd='' diff --git a/lib/sisu/v6/ao_expand_insertions.rb b/lib/sisu/v6/ao_expand_insertions.rb index 63cdc942..8eb0e5c4 100644 --- a/lib/sisu/v6/ao_expand_insertions.rb +++ b/lib/sisu/v6/ao_expand_insertions.rb @@ -356,16 +356,39 @@ module SiSU_AO_Insertions      def expand_insertions?        data=@data        tuned_file,tuned_file_tmp=[],[] -      codeblock_=false +      codeblock_={ +        status: :false, +        type:   :na, +      }        data.each do |para| -        codeblock_=if para =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/ -          true -        elsif para =~/^(?:\}code|```(?:\s|$))/m -          false +        codeblock_=if para =~/^code(?:\.[a-z][0-9a-z_]+)?\{/ \ +        and codeblock_[:status]==:false +          { +            status: :true, +            type:   :curl, +          } +        elsif para =~/^```[ ]+code(?:\.[a-z][0-9a-z_]+)?/ \ +        and codeblock_[:status]==:false +          { +            status: :true, +            type:   :tics, +          } +        elsif codeblock_[:type]==:curl \ +        and para =~/^\}code/m +          { +            status: :false, +            type:   :na, +          } +        elsif codeblock_[:type]==:tics \ +        and para =~/^```(?:\s|$)/m +          { +            status: :false, +            type:   :na, +          }          else codeblock_          end          if para !~/^%+\s/ \ -        and not codeblock_ \ +        and codeblock_[:status] != :true \          and para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/            @u=SiSU_Env::InfoEnv.new.url            m_cmd='' | 
