mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "remove old markdown engine work-in-progress"
This reverts commit ee470b5317.
This commit is contained in:
@@ -80,7 +80,11 @@ module PrettyText
|
||||
ctx_load(ctx, "#{Rails.root}/app/assets/javascripts/discourse-loader.js")
|
||||
ctx_load(ctx, "vendor/assets/javascripts/lodash.js")
|
||||
ctx_load_manifest(ctx, "pretty-text-bundle.js")
|
||||
ctx_load_manifest(ctx, "markdown-it-bundle.js")
|
||||
|
||||
if SiteSetting.enable_experimental_markdown_it
|
||||
ctx_load_manifest(ctx, "markdown-it-bundle.js")
|
||||
end
|
||||
|
||||
root_path = "#{Rails.root}/app/assets/javascripts/"
|
||||
|
||||
apply_es6_file(ctx, root_path, "discourse/lib/utilities")
|
||||
@@ -148,6 +152,13 @@ module PrettyText
|
||||
paths[:S3BaseUrl] = Discourse.store.absolute_base_url
|
||||
end
|
||||
|
||||
if SiteSetting.enable_experimental_markdown_it
|
||||
# defer load markdown it
|
||||
unless context.eval("window.markdownit")
|
||||
ctx_load_manifest(context, "markdown-it-bundle.js")
|
||||
end
|
||||
end
|
||||
|
||||
custom_emoji = {}
|
||||
Emoji.custom.map { |e| custom_emoji[e.name] = e.url }
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ __utils = require('discourse/lib/utilities');
|
||||
__emojiUnicodeReplacer = null;
|
||||
|
||||
__setUnicode = function(replacements) {
|
||||
require('pretty-text/engines/discourse-markdown/emoji').setUnicodeReplacements(replacements);
|
||||
|
||||
let unicodeRegexp = new RegExp(Object.keys(replacements).sort().reverse().join("|"), "g");
|
||||
|
||||
__emojiUnicodeReplacer = function(text) {
|
||||
|
||||
Reference in New Issue
Block a user