keenwrite icon indicating copy to clipboard operation
keenwrite copied to clipboard

Create node visitor for each type of document to process

Open DaveJarvis opened this issue 4 years ago • 0 comments

The MainWindow::spellcheck method performs a spellcheck presuming that the document is Markdown. This isn't always the case: sometimes the document is XML-based. This currently causes no harm because the spellcheck functionality will not operate on XML documents.

Resolving this issue as follows:

  • Create a text visitor interface that can, given a document (either complete or partial), extract the textual content from each node.
  • Implement the visitor interface for Markdown, R Markdown, XML, and R XML.
  • Instantiate the visitor that corresponds to the file type being edited.
  • Remove the hard-coded parser from MainWindow.
  • Remove the TextVisitor class from MainWindow.
  • Reuse the Markdown Parser from the processor for the Markdown-specific TextVisitor.

DaveJarvis avatar Jul 07 '20 04:07 DaveJarvis