Example 318,319 Entity Reference in Links [Kotlin]

I’m not entirely sure why these outputs utilize the numeric encoding for &ouml

Example 318:

 [foo](/föö "föö")
<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> 

(319 is similar)
Just confused how a parser is supposed to know what to do when, as it seems this is the only place that the entity name is replaced with the hex version, while every other place it replaces with the unicode codepoint (excepting HTML and codespans/blocks)

And if replacing entities with hex references in links is mandatory, is there a similar list with the hex values for entities like the one given for all entities with codepoints etc.

It’s not mandatory. The spec doesn’t specify how a commonmark
document is to be rendered to HTML, so you can make a different
decision if you don’t want to URI-encode the URIs (though I think
that’s a good practice).

The automatic tests use HTML as the target language, which goes
beyond what the spec requires. There have been discussions
about using XML

but HTML has been convenient.

Matt Belisle via CommonMark Discussion
noreply@talk.commonmark.org writes:

Thank you so much I somehow didn’t realize that that was just URI encoding haha my bad