> although that will mean that the markup we have isn't a straight transform of markdown => markup,

How so? If you put a mapping of URLs to media objects on the update's `<tr>` (or equivalent) as a data attribute then the JS can replace `<a>`s with appropriate embeds as desired.  No server-side manipulation of the markdown rendered content involved.