Migrate shortcode parsing function and helpers.