@elmethis/core 1.0.0-alpha.165 → 1.0.0-alpha.167

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.
@@ -1,6 +1,5 @@
1
- import { defineComponent, ref, onServerPrefetch, onMounted, onUpdated, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, withCtx, createElementBlock, toDisplayString } from "vue";
1
+ import { defineComponent, ref, onServerPrefetch, onMounted, onUpdated, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, withCtx, createElementBlock, createCommentVNode } from "vue";
2
2
  const _hoisted_1 = ["innerHTML"];
3
- const _hoisted_2 = { key: 1 };
4
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
4
  __name: "ElmKatex",
6
5
  props: {
@@ -9,8 +8,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
9
8
  },
10
9
  setup(__props) {
11
10
  const props = __props;
12
- const isRendered = ref(false);
13
- const html = ref(props.expression);
11
+ const html = ref();
14
12
  let katexRenderToString = null;
15
13
  const loadKatex = async () => {
16
14
  if (!katexRenderToString) {
@@ -23,12 +21,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
21
  };
24
22
  const render = async () => {
25
23
  await loadKatex();
26
- if (!isRendered.value && katexRenderToString) {
24
+ if (!html.value && katexRenderToString) {
27
25
  try {
28
26
  html.value = katexRenderToString(props.expression, {
29
27
  displayMode: props.block
30
28
  });
31
- isRendered.value = true;
32
29
  } catch (err) {
33
30
  console.error("KaTeX rendering error:", err);
34
31
  }
@@ -47,10 +44,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
44
  })
48
45
  }, {
49
46
  default: withCtx(() => [
50
- isRendered.value ? (openBlock(), createElementBlock("span", {
47
+ html.value ? (openBlock(), createElementBlock("span", {
51
48
  key: 0,
52
49
  innerHTML: html.value
53
- }, null, 8, _hoisted_1)) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.expression), 1))
50
+ }, null, 8, _hoisted_1)) : createCommentVNode("", true)
54
51
  ]),
55
52
  _: 1
56
53
  }, 8, ["class", "style"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/core",
3
- "version": "1.0.0-alpha.165",
3
+ "version": "1.0.0-alpha.167",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },