diff -uNr wikit-revs-5rsk.vfs/lib/rskdiff/rskdiff.tcl wikit-revs-6rsk.vfs/lib/rskdiff/rskdiff.tcl
--- wikit-revs-5rsk.vfs/lib/rskdiff/rskdiff.tcl	2008-03-29 22:27:33.000000000 -0500
+++ wikit-revs-6rsk.vfs/lib/rskdiff/rskdiff.tcl	2008-03-29 22:27:02.000000000 -0500
@@ -1,10 +1,37 @@
+proc _perform_diff_isMinimalMatch {a b} {
+	set a [string trim [string tolower $a]]
+	set b [string trim [string tolower $b]]
+
+	# If either line is blank, then never consider it a match
+	if {$a eq "" || $b eq ""} {
+		return 0
+	}
+
+	# Check for match discounting non-alphabetic chars
+	set minA [string tolower [regsub -all {[^a-z]} $a {}]]
+	set minB [string tolower [regsub -all {[^a-z]} $b {}]]
+	if {$minA eq $minB} {
+		return 1
+	}
+
+	# Check compositing
+	if {[string first $minA $minB] != -1} {
+		return 1
+	}
+	if {[string first $minB $minA] != -1} {
+		return 1
+	}
+
+	return 0
+}
+
 # RET:
 #   List of:
 #      = LINE (unchanged)
 #      + LINE (in dest, but not source)
 #      - LINE (in source, but not dest)
 #      M LINE (Minor modification on line)
-proc perform_diff {source dest {splitchar \r\n} {minmatchclass A-Za-z}} {
+proc perform_diff {source dest {splitchar \r\n}} {
 	set source [split $source $splitchar]
 	set dest [split $dest $splitchar]
 
@@ -25,24 +52,21 @@
 		}
 
 		# Check for close equality
-		set minSrcLine [string tolower [regsub -all "\[^$minmatchclass\]" $srcLine {}]]
-		set minDstLine [string tolower [regsub -all "\[^$minmatchclass\]" $dstLine {}]]
-		if {$minSrcLine eq $minDstLine} {
+		if {[_perform_diff_isMinimalMatch $srcLine $dstLine]} {
 			lappend ret [list M $srcLine $dstLine]
 			continue
 		}
 
 		# Look ahead to see if this srcLine occurs in the near future in the output
 		set foundInLookAhead 0
-		for {set idxFwdLine 0} {$idxFwdLine < $lookAheadLines} {incr idxFwdLine} {
+		for {set idxFwdLine 1} {$idxFwdLine < $lookAheadLines} {incr idxFwdLine} {
 			set tryIdx [expr $idxDstLine + $idxFwdLine]
 			if {$tryIdx >= $destLen} {
 				break
 			}
 
 			set tmpDstLine [lindex $dest $tryIdx]
-			set tmpMinDstLine [string tolower [regsub -all "\[^$minmatchclass\]" $tmpDstLine {}]]
-			if {$minSrcLine eq $tmpMinDstLine} {
+			if {[_perform_diff_isMinimalMatch $srcLine $tmpDstLine]} {
 				# We have found a match, so all the intervening lines are in DEST, but not in SOURCE
 				for {set idxCaptured 0} {$idxCaptured < $idxFwdLine} {incr idxCaptured} {
 					set capturedLine [lindex $dest [expr $idxDstLine + $idxCaptured]]
@@ -65,6 +89,38 @@
 			continue
 		}
 
+		# Look ahead to see if this srcLine occurs in the near future in the input (try to resync)
+		set foundInLookAhead 0
+		for {set idxFwdLine 1} {$idxFwdLine < $lookAheadLines} {incr idxFwdLine} {
+			set tryIdx [expr $idxSrcLine + $idxFwdLine]
+			if {$tryIdx >= $sourceLen} {
+				break
+			}
+
+			set tmpSrcLine [lindex $source $tryIdx]
+			if {[_perform_diff_isMinimalMatch $srcLine $tmpSrcLine]} {
+				# We have found a match, so all the intervening lines are in DEST, but not in SOURCE
+				for {set idxCaptured 0} {$idxCaptured < $idxFwdLine} {incr idxCaptured} {
+					set capturedLine [lindex $source [expr $idxSrcLine + $idxCaptured]]
+
+					lappend ret [list - $capturedLine ""]
+				}
+
+				# Move past captured lines
+				incr idxSrcLine $idxFwdLine
+
+				# Note that we have found a match.
+				set foundInLookAhead 1
+				break
+			}
+		}
+		if {$foundInLookAhead} {
+			# Reprocess the current line
+			incr idxDstLine -1
+			incr idxSrcLine -1
+			continue
+		}
+
 		# Not found in look-ahead, this line was probably deleted
 		lappend ret [list - $srcLine]
 		incr idxDstLine -1
diff -uNr wikit-revs-5rsk.vfs/lib/wikit/web.tcl wikit-revs-6rsk.vfs/lib/wikit/web.tcl
--- wikit-revs-5rsk.vfs/lib/wikit/web.tcl	2008-03-29 22:27:33.000000000 -0500
+++ wikit-revs-6rsk.vfs/lib/wikit/web.tcl	2008-03-29 19:16:07.000000000 -0500
@@ -457,29 +457,31 @@
             cgi_puts "<p id=\"diffPage\">"
             foreach diffInfo $revDiff {
               set diffType [lindex $diffInfo 0]
-              set diffOldLine [string map $htmlifymap [lindex $diffInfo 1]]
-              set diffNewLine [string map $htmlifymap [lindex $diffInfo 2]]
+              set diffOldLine [string map $htmlifymap [lindex [string trim $diffInfo] 1]]
+              set diffNewLine [string map $htmlifymap [lindex [string trim $diffInfo] 2]]
+              if {$diffType != "="} {
+                if {$diffOldLine == ""} {
+                   set diffOldLine "<i>(blank line)</i>"
+                }
+                if {$diffNewLine == ""} {
+                  set diffNewLine "<i>(blank line)</i>"
+                }
+              }
               switch -- $diffType {
                 "=" {
                   cgi_puts [cgi_span class=diffSame "$diffOldLine"][nl]
                 }
                 "M" {
-                  if {$diffOldLine == ""} {
-                    set diffOldLine "(blank line)"
-                  }
-                  if {$diffNewLine == ""} {
-                    set diffNewLine "(blank line)"
-                  }
                   set diffModLineOutput [cgi_span class=diffModifiedOld "$diffOldLine"]
                   append diffModLineOutput [cgi_span class=diffModifiedConnector " --> "] 
                   append diffModLineOutput [cgi_span class=diffModifiedNew "$diffNewLine"][nl]
                   cgi_puts [cgi_span class=diffModified $diffModLineOutput]
                 }
                 "+" {
-                  cgi_puts +[cgi_span class=diffNew "$diffNewLine"][nl]
+                  cgi_puts [cgi_span class=diffNew "$diffNewLine"][nl]
                 }
                 "-" {
-                  cgi_puts -[cgi_span class=diffOld "$diffOldLine"][nl]
+                  cgi_puts [cgi_span class=diffOld "$diffOldLine"][nl]
                 }
               }
             }
