summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-20 22:45:06 +0000
committerRalph Amissah <ralph@amissah.com>2014-08-20 22:45:06 +0000
commit0fda4e964a07556aa2de453b841eba46524b84b5 (patch)
treeb1e57f1432272f98757d58630228d24eedd266b1
parentv5 v6: texpdf, output, copyright & license (diff)
downloadsisu-0fda4e964a07556aa2de453b841eba46524b84b5.zip
sisu-0fda4e964a07556aa2de453b841eba46524b84b5.tar.xz
v5 v6: ao_expand_insertions, blocked text match, adjust
-rw-r--r--data/doc/sisu/CHANGELOG_v52
-rw-r--r--data/doc/sisu/CHANGELOG_v62
-rw-r--r--lib/sisu/v5/ao_expand_insertions.rb35
-rw-r--r--lib/sisu/v6/ao_expand_insertions.rb35
4 files changed, 62 insertions, 12 deletions
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index f0bc0f4..bd4cd94 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 82c7d07..f7d7997 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 be326a7..483e9fd 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 63cdc94..8eb0e5c 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=''