At present, plugins need to add additional metadata to generated HTML to support the rich text editor. The metadata tells Joplin how to convert the plugin-generated HTML back to Markdown. The embed-search plugin may not be including this metadata (see the relevant code).