aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/ao_misc_arrange.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/ao_misc_arrange.rb')
-rw-r--r--lib/sisu/v5/ao_misc_arrange.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sisu/v5/ao_misc_arrange.rb b/lib/sisu/v5/ao_misc_arrange.rb
index caf3326c..03d1e735 100644
--- a/lib/sisu/v5/ao_misc_arrange.rb
+++ b/lib/sisu/v5/ao_misc_arrange.rb
@@ -77,22 +77,22 @@ module SiSU_AO_MiscArrangeText
def code_blocks(para)
def ticks(para)
block_open,block_close,text=nil,nil,nil
- 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=~/^[`]{3}\s+table(?:~h)?\s+/) \
- and (para !~/^[`]{3}\s+table(?:~h)?\s+c\d+/)) \
+ if para =~/\A```[ ]+.+?\n.+?\n```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*\Z/m
+ block_open,text,block_close=/\A(```[ ]+.+?)\n(.+?)\n(```(\s+[~-][#]|\s+\~\{.+?\}\~)?)\s*\Z/m.match(para)[1..3]
+ ((para=~/^```[ ]+table(?:~h)?\s+/) \
+ and (para !~/^```[ ]+table(?:~h)?\s+c\d+/)) \
? para
: (para=[]; para << block_open << text << block_close)
- elsif para =~/\A[`]{3}\s+.+?\n.*?\Z/m #look at, study
- block_open,text=/\A([`]{3}(?:\s+.+?))\n(.*?)\Z/m.match(para)[1,2]
+ elsif para =~/\A```[ ]+.+?\n.*?\Z/m #look at, study
+ block_open,text=/\A(```(?:\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[`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*\Z/m
- text,block_close=/\A(.+?)\n([`]{3}(?:\s+[~-][#]|\s+\~\{.+?\}\~)?)\s*\Z/m.match(para)[1,2]
+ elsif para =~/\A.+?\n```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*\Z/m
+ text,block_close=/\A(.+?)\n(```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?)\s*\Z/m.match(para)[1,2]
para=[]
if not text.to_s.empty?
para << text.to_s << block_close