I'm probably on my third rewrite of this simple thing, but the results now look a lot better:
<p><a href=\"mention\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@This is a mention</a> and <a href=\"tag\" class=\"mention hashtag\" rel=\"tag nofollow noopener noreferrer\" target=\"_blank\">#this is a tag</a></p>
[[mention][@This is a mention]] and #this is a tag\n
Also, first time I managed to write a macro in Rust: https://github.com/jbiason/random/blob/master/html5test/src/main.rs
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!