diff options
author | Ralph Amissah <ralph@amissah.com> | 2019-09-02 11:36:58 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-09-03 12:28:38 -0400 |
commit | 143481f23597de24503ea66142cfb8341553d1be (patch) | |
tree | 94eba9fec7cb035d038abf69b83ca440f27bb9eb /lib | |
parent | re-introduce depreciated table markup for table attributes (diff) |
markup modification: code blocks attributes, numberlines
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/ao_doc_str.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 |