artalk 2.5.3 → 2.5.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.
@@ -137,7 +137,8 @@ function onImagesLoaded($container, event) {
137
137
  }
138
138
  }
139
139
  function getGravatarURL(ctx, emailMD5) {
140
- return `${ctx.conf.gravatar.mirror.replace(/\/$/, "")}/${emailMD5}?d=${encodeURIComponent(ctx.conf.gravatar.default)}&s=80`;
140
+ const { mirror, params } = ctx.conf.gravatar;
141
+ return `${mirror.replace(/\/$/, "")}/${emailMD5}?${params.replace(/^\?/, "")}`;
141
142
  }
142
143
  function versionCompare(a, b) {
143
144
  const pa = a.split(".");
@@ -532,6 +533,9 @@ function updateClassName(ctx, darkMode) {
532
533
  }
533
534
  }
534
535
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
536
+ function getDefaultExportFromCjs(x) {
537
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
538
+ }
535
539
  var escapes = {
536
540
  "&": "&",
537
541
  "<": "&lt;",
@@ -921,15 +925,8 @@ function insane(html, options, strict) {
921
925
  }
922
926
  insane.defaults = defaults$1;
923
927
  var insane_1 = insane;
924
- var hanabiExports = {};
925
- var hanabi$1 = {
926
- get exports() {
927
- return hanabiExports;
928
- },
929
- set exports(v) {
930
- hanabiExports = v;
931
- }
932
- };
928
+ const insane$1 = /* @__PURE__ */ getDefaultExportFromCjs(insane_1);
929
+ var hanabi$1 = { exports: {} };
933
930
  (function(module, exports) {
934
931
  (function(global2, factory) {
935
932
  module.exports = factory();
@@ -985,7 +982,8 @@ var hanabi$1 = {
985
982
  return index;
986
983
  });
987
984
  })(hanabi$1);
988
- const hanabi = hanabiExports;
985
+ var hanabiExports = hanabi$1.exports;
986
+ const hanabi = /* @__PURE__ */ getDefaultExportFromCjs(hanabiExports);
989
987
  let instance;
990
988
  function getInstance() {
991
989
  return instance;
@@ -1038,7 +1036,7 @@ function marked(ctx, src) {
1038
1036
  if (!markedContent) {
1039
1037
  markedContent = src.replace(/```\s*([^]+?.*?[^]+?[^]+?)```/g, (_, code) => `<pre><code>${hanabi(code)}</code></pre>`).replace(/!\[(.*?)\]\((.*?)\)/g, (_, alt, imgSrc) => `<img src="${imgSrc}" alt="${alt}" />`).replace(/\[(.*?)\]\((.*?)\)/g, (_, text, link) => `<a href="${link}" target="_blank">${text}</a>`).replace(/\n/g, "<br>");
1040
1038
  }
1041
- let dest = insane_1(markedContent, {
1039
+ let dest = insane$1(markedContent, {
1042
1040
  allowedClasses: {},
1043
1041
  // @refer CVE-2018-8495
1044
1042
  // @link https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8495
@@ -1309,7 +1307,7 @@ function t(key, args = {}) {
1309
1307
  str = str.replace(/\{\s*(\w+?)\s*\}/g, (_, token) => args[token] || "");
1310
1308
  return str;
1311
1309
  }
1312
- const version = "2.5.3";
1310
+ const version = "2.5.5";
1313
1311
  class User {
1314
1312
  constructor() {
1315
1313
  __publicField(this, "ctx");
@@ -2837,8 +2835,8 @@ const defaults = {
2837
2835
  countEl: "#ArtalkCount",
2838
2836
  pvEl: "#ArtalkPV",
2839
2837
  gravatar: {
2840
- default: "mp",
2841
- mirror: "https://cravatar.cn/avatar/"
2838
+ mirror: "https://cravatar.cn/avatar/",
2839
+ params: "d=mp&s=240"
2842
2840
  },
2843
2841
  pagination: {
2844
2842
  pageSize: 20,
@@ -5537,10 +5535,12 @@ function Do(m) {
5537
5535
  } catch (err) {
5538
5536
  console.error(err);
5539
5537
  m.editor.showNotify(`${m.editor.$t("commentFail")},${err.msg || String(err)}`, "e");
5538
+ return;
5539
+ } finally {
5540
+ m.editor.hideLoading();
5540
5541
  }
5541
5542
  m.editor.reset();
5542
5543
  m.editor.ctx.trigger("editor-submitted");
5543
- m.editor.hideLoading();
5544
5544
  });
5545
5545
  }
5546
5546
  function getSubmitAddParams(m) {