satorigear 0.0.3 → 0.0.4

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/dist/index.d.mts CHANGED
@@ -109,6 +109,7 @@ declare module "mdast" {
109
109
  }
110
110
  interface RootContentMap {
111
111
  blockComponent: BlockComponent;
112
+ inlineComponent: InlineComponent;
112
113
  }
113
114
  }
114
115
  //#endregion
package/dist/index.mjs CHANGED
@@ -3075,20 +3075,11 @@ const blockStarts$2 = [{
3075
3075
  }];
3076
3076
  //#endregion
3077
3077
  //#region src/profile/features/component/inline.ts
3078
+ const allowedPrevious = /[ \t\n\r\p{sc=Han}\p{sc=Hira}\p{sc=Kana}\p{sc=Hang}\p{P}]/u;
3078
3079
  function inlineComponentEnd(source, start) {
3079
- const previous = source[start - 1];
3080
- if (start > 0 && previous !== " " && previous !== " " && previous !== "\n" && previous !== "\r" && previous !== "*" && previous !== "_" && previous !== "[") return;
3081
- return componentNameEnd(source, start + 1, false);
3082
- }
3083
- const inlineScans = [{
3084
- marker: 58,
3085
- scan(source, start, tokens) {
3086
- const end = inlineComponentEnd(source, start);
3087
- if (end === void 0) return -1;
3088
- appendInlineToken(tokens, 33, start, end);
3089
- return end;
3090
- }
3091
- }];
3080
+ const prev = source[start - 1];
3081
+ if (start <= 0 || prev !== ":" && allowedPrevious.test(prev)) return componentNameEnd(source, start + 1, false);
3082
+ }
3092
3083
  function appendLinkCandidates(target, candidates) {
3093
3084
  for (const candidate of candidates) {
3094
3085
  candidate.inLinkLabel = true;
@@ -3238,7 +3229,15 @@ const feature$10 = {
3238
3229
  starts: blockStarts$2
3239
3230
  },
3240
3231
  inline: {
3241
- scan: inlineScans,
3232
+ scan: [{
3233
+ marker: 58,
3234
+ scan(source, start, tokens) {
3235
+ const end = inlineComponentEnd(source, start);
3236
+ if (end === void 0) return -1;
3237
+ appendInlineToken(tokens, 33, start, end);
3238
+ return end;
3239
+ }
3240
+ }],
3242
3241
  resolve: { transform: transformComponentTokens },
3243
3242
  build: [{
3244
3243
  kind: "container",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "satorigear",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "Blazing fast Markdown parser with full incremental support that outputs MDAST",
6
6
  "author": "KazariEX",
7
7
  "license": "MIT",