@mirrordown/sat-del 0.0.0-stage → 0.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+ <sub>2026-10-28</sub>
5
+
6
+ - *(minor)*
7
+ `==mark==`, `++ins++` and `--del--` now pair delimiters the same way in every engine. `@mirrordown/core`'s `createDelimitedTransform` ports markdown-it's delimiter algorithm (the one markdown-it-mark and markdown-it-ins use), and the remark and Sätteri plugins run on it:
8
+
9
+ - A closer pairs with the nearest opener: `==a ==b==` highlights only `b`, as markdown-it does.
10
+ - Spans nest: `==a ==b== c==` is a highlight inside a highlight.
11
+ - The extra marker of an odd-length run stays outside the span (`===a===` → `=<mark>a</mark>=`); `mdit-del` compared against `+` instead of `-` here, so its marker ended up inside.
12
+ - `remd-del` no longer mishandles runs such as `--a --- b--` or `--+a+--`, which came from patterns copied from the ins plugin.
13
+
14
+ New Sätteri plugins `@mirrordown/sat-ins` and `@mirrordown/sat-del`, also included in `@mirrordown/preset-satteri`. The `del` guide notes that smart punctuation, on by default in Astro, turns `--` into an en dash before the plugin runs.
15
+ - *(patch)*
16
+ Sätteri 0.11 reads attribute blocks and definition lists the way Mirrordown's other engines do, so the Sätteri suite now covers every feature:
17
+
18
+ - `preset-satteri` has `attrs` and `definitionList` options, on by default like the other presets, which turn on Sätteri's own `attributes` and `definitionList` features. With them, the preset renders every shared fixture as `preset-remark` and `preset-markdown-it` do.
19
+ - The `sat-*` packages accept Sätteri 0.11 as well as 0.10 (`^0.10.5 || ^0.11.0`); Astro's Sätteri integration is still on 0.10, where the plugins work as before.
20
+ - An attribute block ending a tab or step header (`% Tab {.tab}`, `@1. Step {.step}`) now goes on the item in `sat-tabs` and `sat-steps`, as in the other engines: Sätteri read it off the header's paragraph before recognition, and the item didn't get it.
21
+ - `sat-ruby` parses a ruby's base and reading with the document's features, which Sätteri 0.11.3 and later tell plugins; its `features` option is only needed with an older Sätteri.
package/README.md CHANGED
@@ -1,3 +1,66 @@
1
- # Temporary Holding Version
1
+ # @mirrordown/sat-del
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Part of [Mirrordown](https://github.com/mirrordown/mirrordown) — a suite of markdown syntax extensions for the unified, markdown-it and Sätteri ecosystems.
4
+
5
+ A Sätteri plugin for the `del` syntax extension.
6
+
7
+ ## Overview
8
+
9
+ The `del` plugin renders `--text--` as an HTML `<del>` element, representing deleted or struck-through text.
10
+
11
+ ```html
12
+ <del>text</del>
13
+ ```
14
+
15
+ ## Syntax
16
+
17
+ Wrap text in double dashes to mark it as deleted:
18
+
19
+ ````markdown
20
+ --This text has been deleted.--
21
+
22
+ You can use it inline: the price was --$50-- $35.
23
+ ````
24
+
25
+ > [!NOTE]
26
+ > Smart punctuation rewrites `--` as an en dash before this plugin sees it, and Astro turns it on by default (`smartypants` for remark, `smartPunctuation` for Sätteri). Turn it off, or use a Mirrordown preset, which does.
27
+
28
+ ## Install
29
+
30
+ ```sh
31
+ npm install @mirrordown/sat-del
32
+ ```
33
+
34
+ ### Standalone
35
+
36
+ ```ts
37
+ import { markdownToHtml } from "satteri";
38
+ import { satteriDel } from "@mirrordown/sat-del";
39
+
40
+ const { html } = markdownToHtml(source, {
41
+ mdastPlugins: [satteriDel()],
42
+ });
43
+ ```
44
+
45
+ ### Astro
46
+
47
+ ```ts
48
+ // astro.config.ts
49
+ import { defineConfig } from "astro/config";
50
+ import { satteri } from "@astrojs/markdown-satteri";
51
+ import { satteriDel } from "@mirrordown/sat-del";
52
+
53
+ export default defineConfig({
54
+ markdown: {
55
+ processor: satteri({ mdastPlugins: [satteriDel()] }),
56
+ },
57
+ });
58
+ ```
59
+
60
+ ## Documentation
61
+
62
+ Full documentation, more examples, and configuration options: [github.com/mirrordown/mirrordown](https://github.com/mirrordown/mirrordown) (dedicated docs site coming soon).
63
+
64
+ ## License
65
+
66
+ MIT © [Drake Costa](https://saeris.gg)
@@ -0,0 +1,18 @@
1
+ import { MdastPluginInstance, PluginFactoryContext } from "satteri";
2
+ type TextVisitor = NonNullable<MdastPluginInstance["text"]>;
3
+ /**
4
+ * The plugin's definition: only the keys it defines, with a synchronous visitor, so `markdownToHtml` returns its result directly.
5
+ */
6
+ export interface DelPlugin {
7
+ name: string;
8
+ options: {
9
+ position: boolean;
10
+ };
11
+ text: (...args: Parameters<TextVisitor>) => void;
12
+ }
13
+ /**
14
+ * Sätteri plugin for deletion syntax (`--text--`), wrapping each match in a `delete` node that renders as a `<del>` element. The scan is shared with the remark plugin and markdown-it's pairing rules through `@mirrordown/core`; it runs once per parent, the first time one of the parent's text nodes is visited.
15
+ */
16
+ export declare const satteriDel: () => ((ctx: PluginFactoryContext) => DelPlugin);
17
+ export {};
18
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";KAQK,cAAc,YAAY;;;;iBAKd;EACf;EACA;IAAW;;EACX,UAAU,MAAM,WAAW;;;;;qBAMhB,oBACL,KAAK,yBAAyB"}
package/dist/index.mjs ADDED
@@ -0,0 +1,35 @@
1
+ import { createDelimitedTransform } from "@mirrordown/core";
2
+ import { defineMdastPlugin } from "satteri";
3
+ // src/index.ts
4
+ /**
5
+ * Sätteri plugin for deletion syntax (`--text--`), wrapping each match in a `delete` node that renders as a `<del>` element. The scan is shared with the remark plugin and markdown-it's pairing rules through `@mirrordown/core`; it runs once per parent, the first time one of the parent's text nodes is visited.
6
+ */
7
+ const satteriDel = () => ({ source }) => {
8
+ const transform = createDelimitedTransform(`-`, {
9
+ text: (value) => ({
10
+ type: `text`,
11
+ value
12
+ }),
13
+ wrap: (children) => ({
14
+ type: `delete`,
15
+ data: { hName: `del` },
16
+ children
17
+ })
18
+ });
19
+ const seen = /* @__PURE__ */ new WeakSet();
20
+ return defineMdastPlugin({
21
+ name: `del`,
22
+ options: { position: true },
23
+ text(node, ctx) {
24
+ if (!node.value.includes(`--`)) return;
25
+ const parent = ctx.parent(node);
26
+ if (seen.has(parent)) return;
27
+ seen.add(parent);
28
+ const children = transform.withSource(parent.children, parent.type, source);
29
+ if (children) ctx.setProperty(parent, `children`, children);
30
+ }
31
+ });
32
+ };
33
+ export { satteriDel };
34
+
35
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createDelimitedTransform } from \"@mirrordown/core\";\nimport {\n defineMdastPlugin,\n type MdastPluginInstance,\n type MdastTarget,\n type PluginFactoryContext\n} from \"satteri\";\n\ntype TextVisitor = NonNullable<MdastPluginInstance[\"text\"]>;\n\n/**\n * The plugin's definition: only the keys it defines, with a synchronous visitor, so `markdownToHtml` returns its result directly.\n */\nexport interface DelPlugin {\n name: string;\n options: { position: boolean };\n text: (...args: Parameters<TextVisitor>) => void;\n}\n\n/**\n * Sätteri plugin for deletion syntax (`--text--`), wrapping each match in a `delete` node that renders as a `<del>` element. The scan is shared with the remark plugin and markdown-it's pairing rules through `@mirrordown/core`; it runs once per parent, the first time one of the parent's text nodes is visited.\n */\nexport const satteriDel =\n (): ((ctx: PluginFactoryContext) => DelPlugin) =>\n ({ source }) => {\n const transform = createDelimitedTransform<MdastTarget>(`-`, {\n text: (value) => ({ type: `text`, value }),\n wrap: (children) => ({ type: `delete`, data: { hName: `del` }, children })\n });\n const seen = new WeakSet<object>();\n return defineMdastPlugin({\n name: `del`,\n // Positions let the scan tell escaped markers (`\\--`) from real ones.\n options: { position: true },\n text(node, ctx) {\n if (!node.value.includes(`--`)) return;\n const parent = ctx.parent(node);\n if (seen.has(parent)) return;\n seen.add(parent);\n const children = transform.withSource(\n parent.children,\n parent.type,\n source\n );\n if (children) ctx.setProperty(parent, `children`, children);\n }\n });\n };\n"],"mappings":";;;;;;AAsBA,MAAa,oBAEV,EAAE,aAAa;CACd,MAAM,YAAY,yBAAsC,KAAK;EAC3D,OAAO,WAAW;GAAE,MAAM;GAAQ;EAAM;EACxC,OAAO,cAAc;GAAE,MAAM;GAAU,MAAM,EAAE,OAAO,MAAM;GAAG;EAAS;CAC1E,CAAC;CACD,MAAM,uBAAO,IAAI,QAAgB;CACjC,OAAO,kBAAkB;EACvB,MAAM;EAEN,SAAS,EAAE,UAAU,KAAK;EAC1B,KAAK,MAAM,KAAK;GACd,IAAI,CAAC,KAAK,MAAM,SAAS,IAAI,GAAG;GAChC,MAAM,SAAS,IAAI,OAAO,IAAI;GAC9B,IAAI,KAAK,IAAI,MAAM,GAAG;GACtB,KAAK,IAAI,MAAM;GACf,MAAM,WAAW,UAAU,WACzB,OAAO,UACP,OAAO,MACP,MACF;GACA,IAAI,UAAU,IAAI,YAAY,QAAQ,YAAY,QAAQ;EAC5D;CACF,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@mirrordown/sat-del",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "A Sätteri plugin for deletion syntax (--text--), rendering <del> elements.",
4
+ "version": "0.1.0",
5
+ "license": "MIT",
6
+ "author": "Drake Costa <drake@saeris.io> (https://saeris.gg)",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/mirrordown/mirrordown.git"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "type": "module",
15
+ "exports": {
16
+ ".": {
17
+ "development": "./src/index.ts",
18
+ "types": "./dist/index.d.mts",
19
+ "import": "./dist/index.mjs"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@mirrordown/core": "^0.1.0"
24
+ },
25
+ "devDependencies": {
26
+ "satteri": "^0.11.5"
27
+ },
28
+ "peerDependencies": {
29
+ "satteri": "^0.10.5 || ^0.11.0"
30
+ },
31
+ "engines": {
32
+ "node": ">=24.0.0"
33
+ },
34
+ "bumpy": {
35
+ "publishCommand": [
36
+ "node ../../scripts/sync-jsr-version.mjs",
37
+ "node ../../scripts/npm-publish.mjs",
38
+ "node ../../scripts/jsr-resolve-deps.mjs",
39
+ "node ../../scripts/jsr-publish.mjs"
40
+ ]
41
+ }
6
42
  }