The HTML returned by the Mastodon API for status content suddenly changed unannounced, causing my bots to break.

Any API changes really should be documented somewhere (e.g. the release changelog). If endpoints or fields are going to be removed or drastically modified, the existing behavior should at least be marked as deprecated and/or return some warning for some time first.

#MastoDev

@chris what html changed?

@Gargron For mentions in statuses, some instances were returning <a> tags with classes "mention" and "h-card" while other instances had <a class="mention + others"> within a <span class="h-card">.

Do you know if this changed at some point?

@chris Yep but. You can't really do assumptions like that. HTML is sanitized on this end but its generated by various source software. To parse mentions use the mentions attribute on the status :P
@Gargron Got it, thanks :) I'll try to rewrite my logic to not assume as much about the HTML then. I only ran into this issue because @translator tries to parse arguments after the mention (e.g. "@translator <command>"), so the parsing logic ended up depending on the other HTML tags/attributes.