@void/md 0.9.2 → 0.10.1

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.
@@ -280,12 +280,13 @@ async function createCompiler(options) {
280
280
  let lang = token.info ? token.info.split(/\s+/g)[0] : "text";
281
281
  if (!isSpecialLang(lang) && !highlighter.getLoadedLanguages().includes(lang)) if (lang in bundledLanguages) await highlighter.loadLanguage(lang);
282
282
  else lang = "text";
283
+ const rawInfo = token.meta?.rawInfo ?? token.info;
283
284
  return highlighter.codeToHtml(code, {
284
285
  lang,
285
286
  themes,
286
287
  defaultColor: "light",
287
288
  transformers: shikiTransformers,
288
- meta: { __raw: token.info }
289
+ meta: { __raw: rawInfo }
289
290
  });
290
291
  };
291
292
  markdown.use(preWrapperPlugin);
@@ -294,6 +295,13 @@ async function createCompiler(options) {
294
295
  markdown.use(linkPlugin);
295
296
  markdown.use(lineNumberPlugin, false);
296
297
  markdown.use(gitHubAlertsPlugin);
298
+ const stashFenceInfo = (state) => {
299
+ for (const token of state.tokens) if (token.type === "fence") token.meta = {
300
+ ...token.meta,
301
+ rawInfo: token.info
302
+ };
303
+ };
304
+ markdown.core.ruler.after("block", "stash_fence_info", stashFenceInfo);
297
305
  markdown.use(attrs);
298
306
  markdown.use(full);
299
307
  markdown.use(anchor, { permalink: anchor.permalink.ariaHidden({ placement: "before" }) });
package/dist/plugin.mjs CHANGED
@@ -396,8 +396,8 @@ export default defineComponent({
396
396
  //#endregion
397
397
  //#region src/extract-script.ts
398
398
  const SCRIPT_RE = /^<script\b[^>]*>([\s\S]*?)<\/script>\s*\n?/;
399
- const ISLAND_IMPORT_RE = /import\s+(\w+)\s+from\s+("[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*("[^"]+"|'[^']+')\s*\}/g;
400
- const ISLAND_IMPORT_LINE_RE = /^[ \t]*import\s+\w+\s+from\s+(?:"[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*(?:"[^"]+"|'[^']+')\s*\}\s*;?\s*$/gm;
399
+ const ISLAND_IMPORT_RE = /import\s+([$_A-Za-z][$_\w]*)\s+from\s+("[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*("[^"]+"|'[^']+')\s*,?\s*\}/g;
400
+ const ISLAND_IMPORT_LINE_RE = /^[ \t]*import\s+[$_A-Za-z][$_\w]*\s+from\s+(?:"[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*(?:"[^"]+"|'[^']+')\s*,?\s*\}\s*;?\s*$/gm;
401
401
  function extractScript(source) {
402
402
  const match = source.match(SCRIPT_RE);
403
403
  if (!match) return {
@@ -650,7 +650,7 @@ export function useFrontmatter() { return useContext(FrontmatterContext) ?? {};
650
650
  const absPath = resolve(dirname(_id), imp.specifier);
651
651
  imp.islandId = normalizePath(relative(root, absPath)).replace(/\.[^.]+$/, "");
652
652
  }
653
- const { compile } = await import("./compile-zfpn0RR9.mjs");
653
+ const { compile } = await import("./compile-D4HwBWGK.mjs");
654
654
  const result = await compile(body, { shiki: options?.shiki });
655
655
  if (adapter === "vue") {
656
656
  if (islandImports.length > 0) return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/md",
3
- "version": "0.9.2",
3
+ "version": "0.10.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -51,11 +51,11 @@
51
51
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
52
52
  "vite-plus": "^0.1.20",
53
53
  "vue": "^3.5.34",
54
- "void": "0.9.2"
54
+ "void": "0.10.1"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "vite": "^8.0.0",
58
- "void": "0.9.2"
58
+ "void": "0.10.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "vp pack",