FIX: improve block- and inline tag parsing

See https://meta.discourse.org/t/mismatched-quote-tags-are-handled-incorrectly/17958/11