public String Check(IDocument document)
{
acrolinxPlugin.Document = document;
System.Diagnostics.Trace.WriteLine("Content: " + document.Content);
var code = "new function(){var c = window.external.getContent(); "
+ "console.log('Content: ' + c); "
+ "return acrolinxSidebar.checkGlobal(c, {inputFormat:'" + document.Format.ToString().ToUpper() + "', requestDescription:{documentReference: '"
+ document.Reference.Replace("\\", "\\\\").Replace("'", "\\'").Replace("\n", "").Replace("\r", "") + "'}})}();";
dynamic check = Eval(code);
string checkId = check.checkId;
return checkId;
}