private async void ParseDocument() { if (_isProcessing) { return; } _isProcessing = true; await Task.Run(() => { var rawText = _buffer.CurrentSnapshot.GetText(); _doc = MarkdownParser.Parse(rawText, _pipeline); SnapshotSpan span = new SnapshotSpan(_buffer.CurrentSnapshot, 0, _buffer.CurrentSnapshot.Length); ClassificationChanged?.Invoke(this, new ClassificationChangedEventArgs(span)); TagsChanged?.Invoke(this, new SnapshotSpanEventArgs(span)); _isProcessing = false; }); }
private void editor_TextChanged(object sender, EventArgs e) { renderer.DocumentText = MarkdownParser.Parse(editor.Text); }