From 53751a61f05108406967e13827533c11bc448fc6 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 9 Feb 2009 22:20:34 -0600 Subject: [PATCH] Fix Maruku Hanging Bug A Maruku-syntax
with an unclosed IAL (and, it seems, at least one equation) would cause Instiki to hang. Badly. Requiring a 'kill -9' to terminate it. Reverting the OpenDiv and CloseDiv Regexps to my, more simple-minded, versions fixes the problem. --- app/views/svg_logo.html.erb | 14 +++++------ vendor/plugins/maruku/lib/maruku/ext/div.rb | 27 +++++++++++++++++---- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/views/svg_logo.html.erb b/app/views/svg_logo.html.erb index 012fd66f..31448972 100644 --- a/app/views/svg_logo.html.erb +++ b/app/views/svg_logo.html.erb @@ -1,10 +1,10 @@ \ No newline at end of file diff --git a/vendor/plugins/maruku/lib/maruku/ext/div.rb b/vendor/plugins/maruku/lib/maruku/ext/div.rb index 87f4d2f7..efb4e60b 100644 --- a/vendor/plugins/maruku/lib/maruku/ext/div.rb +++ b/vendor/plugins/maruku/lib/maruku/ext/div.rb @@ -10,11 +10,28 @@ #| +-------------------------------------------------- #+--------------------------------------------------- -OpenDiv = /^[ ]{0,3}\+\-\-+\s*(\{([^{}]*|".*"|'.*')*\})?\s*\-*\s*$/ -CloseDiv = /^[ ]{0,3}\=\-\-+\s*(\{([^{}]*|".*"|'.*')*\})?\s*\-*\s*$/ -# note these are not enough for parsing the above example: -#OpenDiv = /^[ ]{0,3}\+\-\-+\s*(.*)$/ -#CloseDiv = /^[ ]{0,3}\=\-\-+\s*(.*)$/ +## These cause Instiki to hang when it encounters +## +## +-- +## ###### Definition +## A _Froelicher Space_ is a triple $(X,C_X,F_X)$ +## =-- {: .num_defn #FroelicherSpace +## +## or +## +## +-- {: .num_defn #FroelicherSpace +## ###### Definition +## A _Froelicher Space_ is a triple $(X,C_X,F_X)$ +## =-- +# +#OpenDiv = /^[ ]{0,3}\+\-\-+\s*(\{([^{}]*|".*"|'.*')*\})?\s*\-*\s*$/ +#CloseDiv = /^[ ]{0,3}\=\-\-+\s*(\{([^{}]*|".*"|'.*')*\})?\s*\-*\s*$/ +# +## note these are not enough for parsing the above example: +## (but they don't produce a hang ...) +# +OpenDiv = /^[ ]{0,3}\+\-\-+\s*(.*)$/ +CloseDiv = /^[ ]{0,3}\=\-\-+\s*(.*)$/ StartPipe = /^[ ]{0,3}\|(.*)$/ # $1 is rest of line DecorativeClosing = OpenDiv