Skip to content
Snippets Groups Projects
Commit f0481e4f authored by andi's avatar andi
Browse files

spellchecker fix for ignoring links

darcs-hash:20050617094826-9977f-d2041cfe4d1698e2b5722cd16c6e6e4a6ac26ac3.gz
parent 241f3a36
No related branches found
No related tags found
No related merge requests found
......@@ -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)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment