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

add comments about errors #399

Open zakirullin opened 1 year ago

zakirullin commented 1 year ago

Hi, thanks for your valuable work!

I've spent some time guessing why Convert method returns errors. My first guess was that the parser returns an error whenever it's unable to parse the input (which is strange). It turned out that the only possible cases for errors are: 1) Provided Writer implementation returns an error 2) User-custom html renderers returns an error

So, in the default scenario there won't be any errors.

I've just highlighted these cases in the comments, so that future developers wouldn't have to spend time for guesswork.

github-actions[bot] commented 5 months ago

This PR is stale because it has been open for 180 days with no activity.