mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
compose: Use rendered_markdown.update_elements for previews.
As we add more features where rendered_markdown.update_elements does something useful, it'll become important to run this code everywhere we render markdown in the DOM. One can see in this case that we had actually copied one hunk of rendered_markdown.update_elements years ago, before we extracted it as an independent function; we get to delete that copy. Fixes #15500.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const rendered_markdown = require("./rendered_markdown");
|
||||
const util = require("./util");
|
||||
const render_compose_all_everyone = require("../templates/compose_all_everyone.hbs");
|
||||
const render_compose_announce = require("../templates/compose_announce.hbs");
|
||||
@@ -799,12 +800,7 @@ exports.render_and_show_preview = function (preview_spinner, preview_content_box
|
||||
}
|
||||
|
||||
preview_content_box.html(util.clean_user_content_links(rendered_preview_html));
|
||||
if (page_params.emojiset === "text") {
|
||||
preview_content_box.find(".emoji").replaceWith(function () {
|
||||
const text = $(this).attr("title");
|
||||
return ":" + text + ":";
|
||||
});
|
||||
}
|
||||
rendered_markdown.update_elements(preview_content_box);
|
||||
}
|
||||
|
||||
if (content.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user