markedjs / marked

A markdown parser and compiler. Built for speed.
https://marked.js.org
Other
33.23k stars 3.39k forks source link

Refactoring Request: Improve Parser.ts Readability and Maintainability #3503

Closed MatMyfta closed 3 weeks ago

MatMyfta commented 1 month ago

Summary: This is purely a code refactoring request.

I noticed that the current implementation has several instances of code repetition. To improve the overall readability and maintainability, I propose a refactor that eliminates these repetitions and makes the code more modular. This should help future developers understand the logic more easily and facilitate further modifications without unnecessary complexity.

All the tests have been run and pass.

Goal: The main objective is to clean up repetitive code and make it more concise and readable, without changing the existing functionality.

Contributor

Committer

In most cases, this should be a different person than the contributor.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 5:28pm
UziTech commented 3 weeks ago

Code readability is very subjective. I don't feel like this is more readable to me. Also this only saves about 10 lines of code, so there doesn't seem to be too much duplication.

Typically removing duplication when the code is only duplicated once is not very helpful. If it was many places and saved hundreds of lines of code I would say it is worth it.

Thanks for trying to make it better though :100: