There are a couple of these macros on the forum.
@JMichaelTX has one somewhere, and there may be others.
Sharing macros to the forum is a trifle tedious, so I've attempted to streamline the process.
My macro is designed specifically for replying and copies the relevant code to the clipboard for pasting into the Keyboard Maestro forum editor.
JM's macro has a few more options than mine and will be of interest to some.
This has only been tested on macOS 10.12.6 with Safari 11 and 12.