yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

improve: create missing RendererFunc error message #166

Closed 13rac1 closed 3 years ago

13rac1 commented 3 years ago

Improve the development debugging process by better handling a missing Node Kind RendererFunc. This:

panic: runtime error: index out of range [22] with length 20

Becomes:

panic: RendererFunc not found for kind: KindName
13rac1 commented 3 years ago

@yuin Is there any issue with this change? It's been sitting a month now.

13rac1 commented 3 years ago

Bumping to avoid Bot closure.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

13rac1 commented 3 years ago

@stale No.

yuin commented 3 years ago

Same PR was submitted before: #107. If I merge this kind of PR, I prioritize older PR over this.

13rac1 commented 3 years ago

In https://github.com/yuin/goldmark/pull/107#issuecomment-596079795

This kind of PR has been submitted before. Works as intended. This is coding problem so it should panic.

I agree, it should panic, which is why my implementation continues to do so, but the message is now useful/helpful and not incorrect/misleading for the developer.

If I merge this kind of PR, I prioritize older PR over this.

Okay, can we merge #110 ? The fact @abhinav, someone else, and myself have all attempted to correct this developer experience speaks to the frustration encountered.