Is Parser.js doing too much? #2031
calculuschild
started this conversation in
Ideas
Replies: 1 comment 11 replies
-
Are you proposing that we remove the |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At a certain point, splitting the functionality of Marked.js across multiple documents becomes harder and harder to track and maintain. Especially when the flow of
source -> token -> html
gets spread across several sections of code. Just looking overparser.js
, it looks like mainly it's just a large switch statement that concatenates the output HTML string by callingrenderers
in the right order. That's fine.Only, there's also large amounts of processing in
parser.js
forTable
andList
tokens which seems out of place. Would it make sense to move that processing into some largerrenderer
s? Instead of the Table renderer just wrapping the Header and Body fromparser.js
in<table>
tags? I suspect the speed would remain similar, while also opening up more of that background processing on theRenderer.js
side for those who want to extend Tables, for instance.It seems like the core functions should be delineated as follows:
Beta Was this translation helpful? Give feedback.
All reactions