nodebb-plugin-markdown 13.0.0-pre.9 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -10
- package/package-lock.json +2161 -775
- package/package.json +1 -1
- package/public/languages/de/markdown.json +1 -1
- package/public/languages/en-GB/markdown.json +1 -1
- package/public/languages/fr/markdown.json +1 -1
- package/public/languages/pl/markdown.json +1 -1
- package/public/languages/ru/markdown.json +1 -1
- package/public/languages/tr/markdown.json +1 -1
- package/public/templates/modals/markdown-help.tpl +3 -0
package/index.js
CHANGED
|
@@ -8,7 +8,6 @@ const nconf = require.main.require('nconf');
|
|
|
8
8
|
const winston = require.main.require('winston');
|
|
9
9
|
const meta = require.main.require('./src/meta');
|
|
10
10
|
const activitypub = require.main.require('./src/activitypub');
|
|
11
|
-
const translator = require.main.require('./src/translator');
|
|
12
11
|
const plugins = require.main.require('./src/plugins');
|
|
13
12
|
|
|
14
13
|
const SocketPlugins = require.main.require('./src/socket.io/plugins');
|
|
@@ -167,12 +166,14 @@ const Markdown = {
|
|
|
167
166
|
|
|
168
167
|
({ env } = await plugins.hooks.fire('filter:markdown.beforeParse', { env, data: Object.freeze({ ...data }) }));
|
|
169
168
|
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
if (activitypub.helpers.isUri(data.postData.pid)) {
|
|
170
|
+
if (data.postData.sourceContent) {
|
|
171
|
+
data.content = data.sourceContent;
|
|
172
|
+
delete data.sourceContent;
|
|
173
|
+
} else {
|
|
174
|
+
// content contained is likely already html, bypass parsing
|
|
175
|
+
env.parse = false;
|
|
176
|
+
}
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
return env;
|
|
@@ -207,10 +208,8 @@ const Markdown = {
|
|
|
207
208
|
},
|
|
208
209
|
|
|
209
210
|
renderHelp: async function (helpContent) {
|
|
210
|
-
const translated = await translator.translate('[[markdown:help-text]]');
|
|
211
|
-
const parsed = await plugins.hooks.fire('filter:parse.raw', `## Markdown\n${translated}`);
|
|
212
211
|
const html = await app.renderAsync('modals/markdown-help', {});
|
|
213
|
-
helpContent +=
|
|
212
|
+
helpContent += html;
|
|
214
213
|
return helpContent;
|
|
215
214
|
},
|
|
216
215
|
|