From 143481f23597de24503ea66142cfb8341553d1be Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 2 Sep 2019 11:36:58 -0400 Subject: markup modification: code blocks attributes, numberlines --- lib/sisu/ao_doc_str.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/sisu/ao_doc_str.rb b/lib/sisu/ao_doc_str.rb index eec2cbad..1aba9bd7 100644 --- a/lib/sisu/ao_doc_str.rb +++ b/lib/sisu/ao_doc_str.rb @@ -296,8 +296,8 @@ module SiSU_AO_DocumentStructureExtract else nil end end - if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \ - and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \ + if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \ + and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \ and @per.code==:off \ and @per.poem==:off \ and @per.group==:off \ @@ -497,15 +497,15 @@ module SiSU_AO_DocumentStructureExtract t_o=SiSU_AO_DocumentStructureExtract::Structure.new(@md).structure_markup(t_o) #must happen earlier, node info etc. require end elsif @per.code==:off - if t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/ + if t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?)/ @per.code=case t_o - when /^code(?:\.[a-z][0-9a-z_]+)?\{/ then :curls + when /^code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?\{/ then :curls when /^```[ ]+code/ then :tics else @per.code #error end - @per.lngsyn=if t_o =~/^(?:code\.[a-z][0-9a-z_]+\{|```[ ]+code\.[a-z_]+)/ + @per.lngsyn=if t_o =~/^(?:code\.[a-z][0-9a-z_]+(?:\(.+?\))?\{|```[ ]+code\.[a-z_]+)/ case t_o - when /^code\.([a-z][0-9a-z_]+)\{/ + when /^code\.([a-z][0-9a-z_]+)(?:\(.+?\))?\{/ :"#{$1}" when /^```[ ]+code\.([a-z][0-9a-z_]+)/ :"#{$1}" @@ -515,7 +515,7 @@ module SiSU_AO_DocumentStructureExtract end @@counter=1 @codeblock_numbered= - (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{#|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\s[#])/) \ + (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\)\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\))/) \ ? true : false @num_id[:code_block] +=1 -- cgit v1.2.3