diff options
author | andi <andi@splitbrain.org> | 2005-06-17 11:48:26 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-06-17 11:48:26 +0200 |
commit | f0481e4f9a2d86fad0757d829e3edbe64539cd61 (patch) | |
tree | ae9441538e12a036856f7766c479a554e18ae20f | |
parent | 241f3a361bd5977e2271eb2b94fd6c8300639d74 (diff) | |
download | rpg-f0481e4f9a2d86fad0757d829e3edbe64539cd61.tar.gz rpg-f0481e4f9a2d86fad0757d829e3edbe64539cd61.tar.bz2 |
spellchecker fix for ignoring links
darcs-hash:20050617094826-9977f-d2041cfe4d1698e2b5722cd16c6e6e4a6ac26ac3.gz
-rw-r--r-- | lib/exe/spellcheck.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php index 86e0e438e..5af5c43dd 100644 --- a/lib/exe/spellcheck.php +++ b/lib/exe/spellcheck.php @@ -77,6 +77,8 @@ if(function_exists($call)){ * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net> */ function spaceslink($string, $check=""){ + $string = stripslashes($string); + $check = stripslashes($check); $result = str_pad($check,utf8_strlen($string)-2," ",STR_PAD_LEFT); return $result." "; } @@ -106,9 +108,9 @@ function spell_check() { $data = explode("\n",$string); // don't check links and medialinks for spelling errors - $string = preg_replace('/\{\{[^\|]*\|?(.*)\}\}/e','spaceslink("\\0","\\1")',$string); - $string = preg_replace('/\[\[[^\|]*\|?(.*)\]\]/e','spaceslink("\\0","\\1")',$string); - + $string = preg_replace('/\{\{(.*?)(\|(.*?))?(\}\})/e','spaceslink("\\0","\\3")',$string); + $string = preg_replace('/\[\[(.*?)(\|(.*?))?(\]\])/e','spaceslink("\\0","\\3")',$string); + // run aspell in terse sgml mode if(!$spell->runAspell($string,$out,$err,array('!','+html'))){ //if(!$spell->runAspell($string,$out,$err)){ |