UPDATE answer
SET content =
    CASE
        WHEN content ~ '<tr>|<td>' THEN
            regexp_replace(content, '<\/?tr[^>]*>|<\/?td[^>]*>', '', 'g')
        WHEN content ~ '<a download>[^<]+</a>' THEN
            regexp_replace(content, '<a download>([^<]+)</a>', '\1', 'g')
        WHEN content ~ '<img[^>]*src="([^"]*)"[^>]*' THEN
            regexp_replace(content, '<img[^>]*src="\s*"[^>]*', '', 'g')
        ELSE content
    END;

UPDATE answer
SET content =
    CASE
        WHEN content ~ '<img' THEN
            regexp_replace(content, '(.*?)(<img[^>]*src=["'']?([^"''>]+)["'']?[^>]*>)', '\1\3', 'g')
        ELSE content
    END;
