Hey, project lead for Matrix here. Yup, we’re aware that it’s a bit naughty to put unescaped #'s in URL fragments, but in practice this is the first time in two years we’ve seen anyone actually hitting it as a bug! The workaround is of course to escape it properly as %23.
We’ll have a think about the right way to fix this - perhaps we should switch to using Unicode Character 'VIEWDATA SQUARE' (U+2317) instead O:-)
In the interim it might be kind to consider tweaking your parser to be slightly more forgiving on what it accepts however, in accordance with Postel’s law.
In other news, I can’t wait for someone to implement a Discourse<->Matrix bridge, rather than clunky hyperlinking between the two!