nodebb-plugin-katex2 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-katex2",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "KaTeX math rendering plugin for NodeBB",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
package/plugin.json CHANGED
@@ -11,8 +11,7 @@
11
11
  }
12
12
  ],
13
13
  "scripts": ["static/js/render.js"],
14
- "stylesheets": ["static/css/katex.css"],
15
14
  "staticDirs": {
16
- "katex": "./static/katex"
15
+ "katex": "node_modules/katex/dist"
17
16
  }
18
17
  }
@@ -120,7 +120,7 @@
120
120
  // const basePath = "/plugins/nodebb-plugin-katex/node_modules/katex/dist/";
121
121
  // Находим правильный путь
122
122
  // Путь к файлам через modules
123
- const basePath = "/assets/plugins/nodebb-plugin-katex/katex/";
123
+ const basePath = "/assets/plugins/nodebb-plugin-katex2/katex/";
124
124
 
125
125
  // Параллельная загрузка всех файлов
126
126
  await Promise.all([
@@ -223,6 +223,7 @@
223
223
  * Рендеринг всех постов (async)
224
224
  */
225
225
  async function renderAllPosts() {
226
+ console.log("[KaTeX] Try rendering");
226
227
  // Проверяем наличие формул
227
228
  if (!hasMathContent()) {
228
229
  console.log("[KaTeX] No math content found, skipping");
@@ -262,7 +263,9 @@
262
263
  */
263
264
  function init() {
264
265
  // Первый рендеринг
265
- renderAllPosts();
266
+ setTimeout(function () {
267
+ renderAllPosts();
268
+ }, 500);
266
269
 
267
270
  // События NodeBB для динамического контента
268
271
 
@@ -270,21 +273,21 @@
270
273
  window.addEventListener("action:posts.loaded", function () {
271
274
  setTimeout(function () {
272
275
  renderAllPosts();
273
- }, 50);
276
+ }, 500);
274
277
  });
275
278
 
276
279
  // Когда открывается тема
277
280
  window.addEventListener("action:topic.loaded", function () {
278
281
  setTimeout(function () {
279
282
  renderAllPosts();
280
- }, 50);
283
+ }, 500);
281
284
  });
282
285
 
283
286
  // Когда происходит навигация
284
287
  window.addEventListener("action:ajaxify.end", function () {
285
288
  setTimeout(function () {
286
289
  renderAllPosts();
287
- }, 100);
290
+ }, 800);
288
291
  });
289
292
 
290
293
  // Когда обновляется превью в редакторе