Commit info for scoop/lib/Scoop:

Modified Files:
	Spellchecker.pm Utility.pm 
Log Message:
Spellchecker and Autoformat fixes by gazbo (Gary Whittles)
Stops spellchecker checking urls, and entities. It also improves the
handling of lists. Numbers need to start a line, and have a space after
them to be turned into a list.


Index: Spellchecker.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Spellchecker.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -r1.7 -r1.8
78a79,84
> 	#my $url_regexg = '(?:http|ftp|file)://[^\s<]+(?=\s)';
> 	my $url_regexg = '(?:http|ftp|file)://(?:[^\s<\Z])+(?=[\s<]|\Z)';
> 	my $entity_regexg = '&\w+;';
> 	# word_regexg is unicode aware
> 	my $word_regexg = '[\p{IsAlnum}\'\|]+';
> 
82c88,89
< 	$string =~ s/([\w'\|]+)/$S->_spellcheck_word($1, $callback)/eg;
---
> 	# Split string into URLs and entities, which are returned verbatim, and words, which are spellchecked
> 	$string =~ s#($url_regexg)|($entity_regexg)|($word_regexg)#$1 . $2 . $S->_spellcheck_word($3,$callback)#eg;

Index: Utility.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Utility.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -r1.29 -r1.30
860,861c860,862
< 	my $url_regex = '(?:http|ftp|file)://[^\s<]+?';
< 	my $url_regexg = '(?:http|ftp|file)://[^\s<]+'; # greedy
---
> 	# Don't match URLs with <> in them
> 	my $url_regex = '(?:http|ftp|file)://[^\s<>]+?';
> 	my $url_regexg = '(?:http|ftp|file)://[^\s<>]+'; # greedy
877c878
< 	s#([^\x00]|^)($url_regex)(?=[.!?_*=]?[\s\n<()\[\]{}\x01\x02]|$)#$1<a href="$2">$2</a>#gmio;
---
>  	s#([^\x00]|^)($url_regex)(?=[.!?_*=]?[\s\n<()\[\]{}\x01\x02]|$)#$1<a href="$2">$2</a>#gmio;
898c899,901
< 	s#(?<![A-Za-z0-9])=(\S|\S.*?\S)=(?=[^A-Za-z0-9]|<br>|<p>|$)#<code>$1</code>#gs;
---
> 
> 	# Don't match '="' as a closing tag, as it is probably an attribute
> 	s#(?<![A-Za-z0-9])=(\S|\S.*?\S)=(?=[^A-Za-z0-9"]|<br>|<p>|$)#<code>$1</code>#gs;
901c904
< 	s#(?<![A-Za-z0-9/:<])/(\S|\S.*?[^\s<:/])/(?=[^A-Za-z0-9]|<br>|<p>|$)#<em>$1</em>#gs;
---
> 	s#(?<![A-Za-z0-9/:<=])/(\S|\S.*?[^\s<:/])/(?=[^A-Za-z0-9]|<br>|<p>|$)#<em>$1</em>#gs;
930c933
< Creates numbered lists from series of lines beginning in 'n.' or 'n)', where
---
> Creates numbered lists from series of lines beginning in 'n. ', 'n) ' or 'n: ', where
941c944
< 	s#((?:<(?:br|p)>\n)?(?:^[0-9]+[.)]?\s*.*(?:\n|$)){2,})#
---
> 	s#((?:<(?:br|p)>\n)?(?:^[0-9]+[.):]\s+.*(?:\n|$)){2,})#
943c946
< 		$a =~ s!^([0-9]+)[.)]?!<li value="$1">!gm;
---
> 		$a =~ s!^([0-9]+)[.):]\s+!<li value="$1">!gm;
947a951
>