-
-
Notifications
You must be signed in to change notification settings - Fork 224
Open
Description
To reduce the scope of this package (easier to maintain), how about this:
- Remove the
walker
interface. Instead, the AST parser builds into a real DOM directly.- On the browser, this would be an instance of
Document
(that's what e.g. DOM Parser would output). - In node, something like JSDOM can be used.
- So either of those two would be a dependency for this library.
- On the browser, this would be an instance of
- That way, any sanitization or other DOM modification could either use an existing library, such as DOMPurify or write their own code using e.g.
myDocument.querySelectorAll
. - Rendering to an HTML string be as simple as
myDocument.innerHTML
, and others will likely just append that doc into the DOM directly, without ever producing an HTML string (perf win).
This change would radically lower the scope of this package (building on the shoulder of giants; existing web APIs basically), and would still preserve everything that's unique about this library, which is markdown parsing.
Metadata
Metadata
Assignees
Labels
No labels