Improve performance of getNextEmbedBlock by removing unnecessary preg_match and function calls.