                 onError(PreviewError.noURLHasBeenFound(text))
             }
         }
+        
+        return { cancellable.isCancelled = true }
     }
 }
 

            do {
                let data = try Data(contentsOf: sourceUrl!)
                if let source = String(data: data, encoding: .utf8) {
                    self.parseHtmlString(source, canonicalUrl: canonicalUrl, completion: completion)
                } else {
                    self.tryAnotherEnconding(sourceUrl!, canonicalUrl: canonicalUrl, data: data, encodingArray: String.availableStringEncodings, completion: completion, onError: onError)
                }
            } catch {
                onError(.cannotBeOpened(sourceUrl!.absoluteString))
            }
        }
    }

    }
    
}

fileprivate class Cancellable {
    var isCancelled : Bool = false
}
