One would think that this could easily be solved by shortcodes, which already exist and are in wide use.