Yesterday, I released Markdown Code For WordPress – an extremely simple plugin that makes it easy to replace Markdown backticks (`) with inline code comments. As mentioned in the post, it scratches an itch of my own that I’ve opted to share just in case anyone else shares the same, y’know, itch.
In the comments, Konstantin left a great question that I felt was worth discussing further:
Why not carry out the search and replace once before the post is saved and not every time it is displayed?
I left a response in the comments:
I didn’t want to do prior to saving the post just in case people use it, opt to disable the plugin, and then want to go with some other markdown editor or some other plugin. This keeps the original tokens in take so they can do a search and replace for it.
In short, I’ve had less than stellar experiences (read: back feedback) when it comes to mucking with data prior to saving it with the database especially when users want to abandon the plugin.
But I thought this was a great question that warranted a deeper discuss and wanted to bring it up here to get the rest of opinions from fellow developers.