I changed the JSON output from the search engine 

Instead of the cite field there is now citation_text, citation_markdown and citation_html. This commit modifies the userscript to use citation_markdown in the post, and citation_html in the preview. Hopefully correct, but not tested at all.