summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-12 17:42:41 +0200
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-12 17:42:41 +0200
commit409f26c8f6fa4e96f27030b5d38ffaf6acc83419 (patch)
treeb90c9b92976dcbd467187917709aa6dfad00aacc /lib
parent6d4475036a41d6ccada7b5f5adf809e20fcd97ef (diff)
downloadrpg-409f26c8f6fa4e96f27030b5d38ffaf6acc83419.tar.gz
rpg-409f26c8f6fa4e96f27030b5d38ffaf6acc83419.tar.bz2
spellchecker fix for broken aspell
The current Aspell version has a bug that causes a corrupt output file. Output lines beginning with '?' weren't terminated with a newline. This patch fixes the broken output format. It is not possible to detect automatically if a Aspell version handles '?'-lines correctly. Therefore DokuWiki checks for Aspells version number and corrects the output format accordingly if version < darcs-hash:20050612154241-7ef76-dfa98470651d6701562ca51908e6f8c8392b28bd.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/spellcheck.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php
index d8faa0291..d9086f9c6 100644
--- a/lib/exe/spellcheck.php
+++ b/lib/exe/spellcheck.php
@@ -141,29 +141,9 @@ function spell_check() {
return;
}
-
$misspell = true;
$len = utf8_strlen($word);
-
- // try to insert markup
- // Aspell sometimes returns too few blank lines, the following loop
- // tries to compensate by skipping to next line if Aspell's output
- // doesn't match - we're skipping maximal 2 lines before giving up and
- // throwing an error
- for($x=0; $x<3; $x++){
- $lcnt -= $x;
- if(utf8_substr($data[$lcnt],$off,$len) == $word){
- $data[$lcnt] = utf8_substr_replace($data[$lcnt],
- spell_formatword($word,$sug),
- $off, $len);
- break;
- }elseif($x == 2){
- print '2';
- print "The spellchecker output doesn't match the input data.\n";
- print "Offending word: '$word' offset: $off, line $i";
- return;
- }
- }
+ $data[$lcnt] = utf8_substr_replace($data[$lcnt],spell_formatword($word,$sug),$off, $len);
}//end of output parsing