@isdk/mdast-plus 0.1.1 → 0.1.2

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/README.cn.md CHANGED
@@ -17,6 +17,7 @@
17
17
  - **表格跨行/跨列**: 支持 HTML 输出中的 `rowspan` 和 `colspan`。
18
18
  - **代码元数据**: 对代码块元数据字符串进行结构化解析。
19
19
  - **图片尺寸**: 支持 URL 糖语法 (例如 `image.png#=500x300`) 来设置图片尺寸。
20
+ - **行内样式**: 内置对 `==高亮==`、`~下标~` 和 `^上标^` 的支持。
20
21
  - **深度类型支持**: 基于 TypeScript 构建,完整支持 unist/mdast 的模块扩充。
21
22
 
22
23
  ## 安装
@@ -46,6 +47,13 @@ const html = await mdast('![Cat](cat.png#=500x300)').toHTML();
46
47
  // 结果: <img src="cat.png" alt="Cat" width="500" height="300">
47
48
  ```
48
49
 
50
+ ### AST 输出
51
+
52
+ ```typescript
53
+ const ast = await mdast('==高亮内容==').toAST();
54
+ // 返回 mdast Root 对象
55
+ ```
56
+
49
57
  ### 高级工作流
50
58
 
51
59
  ```typescript
@@ -99,6 +107,7 @@ const result = await mdast('Hello').to('reverse');
99
107
  | `normalize-table-span` | normalize | 将表格单元格跨度迁移到 `hProperties`。 |
100
108
  | `extract-code-meta` | normalize | 从代码块元数据中解析 `title="foo"`。 |
101
109
  | `image-size` | normalize | 从图片 URL 中解析 `#=WxH`。 |
110
+ | `normalize-inline-styles` | normalize | 标准化 `==mark==`、`~sub~` 和 `^sup^`。 |
102
111
 
103
112
  ## 贡献
104
113
 
package/README.md CHANGED
@@ -17,6 +17,7 @@ English | [简体中文](./README.cn.md) | [GitHub](https://github.com/isdk/mdas
17
17
  - **Table Spans**: Support for `rowspan` and `colspan` in HTML output.
18
18
  - **Code Meta**: Structured parsing of code block metadata strings.
19
19
  - **Image Sizing**: URL "sugar" support (e.g., `image.png#=500x300`) for image dimensions.
20
+ - **Inline Styles**: Built-in support for `==Highlight==`, `~Subscript~`, and `^Superscript^`.
20
21
  - **Deeply Typed**: Built on TypeScript with full support for unist/mdast module augmentation.
21
22
 
22
23
  ## Installation
@@ -46,6 +47,13 @@ const html = await mdast('![Cat](cat.png#=500x300)').toHTML();
46
47
  // Result: <img src="cat.png" alt="Cat" width="500" height="300">
47
48
  ```
48
49
 
50
+ ### AST Output
51
+
52
+ ```typescript
53
+ const ast = await mdast('==Highlighted==').toAST();
54
+ // Returns the mdast Root object
55
+ ```
56
+
49
57
  ### Advanced Pipeline
50
58
 
51
59
  ```typescript
@@ -99,6 +107,7 @@ Plugins are executed based on their `stage` and `order`:
99
107
  | `normalize-table-span` | normalize | Migrates table cell spans to `hProperties`. |
100
108
  | `extract-code-meta` | normalize | Parses `title="foo"` from code block meta. |
101
109
  | `image-size` | normalize | Parses `#=WxH` from image URLs. |
110
+ | `normalize-inline-styles` | normalize | Standardizes `==mark==`, `~sub~`, and `^sup^`. |
102
111
 
103
112
  ## Contributing
104
113
 
package/dist/index.d.mts CHANGED
@@ -1340,6 +1340,11 @@ declare class FluentProcessor {
1340
1340
  * @returns A promise resolving to the HTML string
1341
1341
  */
1342
1342
  toHTML(): Promise<string>;
1343
+ /**
1344
+ * Helper to get the processed mdast tree.
1345
+ * @returns A promise resolving to the mdast Root node
1346
+ */
1347
+ toAST(): Promise<Root>;
1343
1348
  }
1344
1349
  /**
1345
1350
  * Entry point for the fluent mdast-plus API.
@@ -1349,15 +1354,23 @@ declare class FluentProcessor {
1349
1354
  declare function mdast(input: any): FluentProcessor;
1350
1355
 
1351
1356
  /**
1352
- * Unified plugin/configuration for Markdown format.
1353
- * Includes GFM, directives, math, and frontmatter.
1357
+ * Common remark configuration for Markdown.
1358
+ */
1359
+ declare function markdownCommon(this: any): void;
1360
+ /**
1361
+ * Markdown format definition for FluentProcessor.
1362
+ * Handles both parsing (Markdown -> MDAST) and stringifying (MDAST -> Markdown).
1354
1363
  */
1355
- declare function markdownFormat(this: any): void;
1364
+ declare const markdownFormat: MdastFormatDefinition;
1356
1365
 
1357
1366
  /**
1358
- * Unified plugin/configuration for HTML format.
1359
- * Includes mdast-to-hast conversion, sanitization (with table span support), and stringification.
1367
+ * Standard compiler/stringifier for HTML.
1368
+ */
1369
+ declare function htmlStringify(this: any): void;
1370
+ /**
1371
+ * HTML format definition for FluentProcessor.
1372
+ * Handles both parsing (HTML -> MDAST) and stringifying (MDAST -> HTML).
1360
1373
  */
1361
- declare function htmlFormat(this: any): void;
1374
+ declare const htmlFormat: MdastFormatDefinition;
1362
1375
 
1363
- export { type ConvertResult, FluentProcessor, type MdastAsset, type MdastDataOrigin, type MdastFormatDefinition, type MdastMark, type MdastPlugin, type MdastReader, type MdastSub, type MdastSup, type MdastTransformer, type MdastWriter, type Stage, htmlFormat, markdownFormat, mdast };
1376
+ export { type ConvertResult, FluentProcessor, type MdastAsset, type MdastDataOrigin, type MdastFormatDefinition, type MdastMark, type MdastPlugin, type MdastReader, type MdastSub, type MdastSup, type MdastTransformer, type MdastWriter, type Stage, htmlFormat, htmlStringify, markdownCommon, markdownFormat, mdast };
package/dist/index.d.ts CHANGED
@@ -1340,6 +1340,11 @@ declare class FluentProcessor {
1340
1340
  * @returns A promise resolving to the HTML string
1341
1341
  */
1342
1342
  toHTML(): Promise<string>;
1343
+ /**
1344
+ * Helper to get the processed mdast tree.
1345
+ * @returns A promise resolving to the mdast Root node
1346
+ */
1347
+ toAST(): Promise<Root>;
1343
1348
  }
1344
1349
  /**
1345
1350
  * Entry point for the fluent mdast-plus API.
@@ -1349,15 +1354,23 @@ declare class FluentProcessor {
1349
1354
  declare function mdast(input: any): FluentProcessor;
1350
1355
 
1351
1356
  /**
1352
- * Unified plugin/configuration for Markdown format.
1353
- * Includes GFM, directives, math, and frontmatter.
1357
+ * Common remark configuration for Markdown.
1358
+ */
1359
+ declare function markdownCommon(this: any): void;
1360
+ /**
1361
+ * Markdown format definition for FluentProcessor.
1362
+ * Handles both parsing (Markdown -> MDAST) and stringifying (MDAST -> Markdown).
1354
1363
  */
1355
- declare function markdownFormat(this: any): void;
1364
+ declare const markdownFormat: MdastFormatDefinition;
1356
1365
 
1357
1366
  /**
1358
- * Unified plugin/configuration for HTML format.
1359
- * Includes mdast-to-hast conversion, sanitization (with table span support), and stringification.
1367
+ * Standard compiler/stringifier for HTML.
1368
+ */
1369
+ declare function htmlStringify(this: any): void;
1370
+ /**
1371
+ * HTML format definition for FluentProcessor.
1372
+ * Handles both parsing (HTML -> MDAST) and stringifying (MDAST -> HTML).
1360
1373
  */
1361
- declare function htmlFormat(this: any): void;
1374
+ declare const htmlFormat: MdastFormatDefinition;
1362
1375
 
1363
- export { type ConvertResult, FluentProcessor, type MdastAsset, type MdastDataOrigin, type MdastFormatDefinition, type MdastMark, type MdastPlugin, type MdastReader, type MdastSub, type MdastSup, type MdastTransformer, type MdastWriter, type Stage, htmlFormat, markdownFormat, mdast };
1376
+ export { type ConvertResult, FluentProcessor, type MdastAsset, type MdastDataOrigin, type MdastFormatDefinition, type MdastMark, type MdastPlugin, type MdastReader, type MdastSub, type MdastSup, type MdastTransformer, type MdastWriter, type Stage, htmlFormat, htmlStringify, markdownCommon, markdownFormat, mdast };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(e,t,a,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let u of n(t))s.call(e,u)||u===a||r(e,u,{get:()=>t[u],enumerable:!(o=i(t,u))||o.enumerable});return e},u=(e,i,n)=>(n=null!=e?t(a(e)):{},o(!i&&e&&e.__esModule?n:r(n,"default",{value:e,enumerable:!0}),e)),l={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(l,{FluentProcessor:()=>B,htmlFormat:()=>z,markdownFormat:()=>w,mdast:()=>C}),module.exports=(e=l,o(r({},"__esModule",{value:!0}),e));var c=require("unified"),m=u(require("remark-parse")),h=u(require("remark-stringify")),f=u(require("rehype-parse")),d=u(require("rehype-remark")),p=u(require("remark-gfm")),v=u(require("remark-directive")),g=u(require("remark-math")),y=u(require("remark-frontmatter"));function w(){const e=this.data();var t,r;r={handlers:{mark:(e,t,r)=>"=="+r.containerPhrasing(e,{before:"==",after:"=="})+"==",sub:(e,t,r)=>"~"+r.containerPhrasing(e,{before:"~",after:"~"})+"~",sup:(e,t,r)=>"^"+r.containerPhrasing(e,{before:"^",after:"^"})+"^"}},e[t="toMarkdownExtensions"]?e[t].push(r):e[t]=[r],this.use(p.default,{singleTilde:!1}).use(v.default).use(g.default).use(y.default,["yaml","toml"])}var b=u(require("remark-rehype")),k=u(require("rehype-sanitize")),q=u(require("rehype-stringify"));function z(){this.use(b.default).use(k.default,{...k.defaultSchema,tagNames:[...k.defaultSchema.tagNames||[],"mark","sub","sup"],attributes:{...k.defaultSchema.attributes,"*":[...k.defaultSchema.attributes?.["*"]||[],"className","id","style"],td:[...k.defaultSchema.attributes?.td||[],"rowSpan","colSpan","rowspan","colspan"],th:[...k.defaultSchema.attributes?.th||[],"rowSpan","colSpan","rowspan","colspan"],img:[...k.defaultSchema.attributes?.img||[],"width","height"]}}).use(q.default)}var x=require("unist-util-visit"),j={error:"danger",warn:"warning",success:"tip",important:"important",caution:"caution",note:"note"},O={name:"normalize-directive",stage:"normalize",order:10,transform:async e=>{(0,x.visit)(e,["containerDirective","leafDirective","textDirective"],e=>{const t=e,r=t.name.toLowerCase();if(t.name=j[r]||r,t.children&&t.children.length>0){const e=t.children[0];if(e.data?.directiveLabel||"directiveLabel"===e.type){const r=e;let i="";(0,x.visit)(r,"text",e=>{i+=e.value}),i&&!t.attributes?.title&&(t.attributes=t.attributes||{},t.attributes.title=i.trim()),t.children.shift()}}t.attributes?.title&&(t.attributes.title=String(t.attributes.title).trim()),t.data=t.data||{},t.data.hName=t.data.hName||("containerDirective"===t.type?"div":"span"),t.data.hProperties={...t.data.hProperties||{},...t.attributes,className:[t.name,t.data.hProperties?.className].filter(Boolean).join(" ")}})}},S=require("unist-util-visit"),D={name:"normalize-table-span",stage:"normalize",order:20,transform:async e=>{(0,S.visit)(e,"tableCell",e=>{if(e.data){const{rowspan:t,colspan:r}=e.data;e.data.hProperties=e.data.hProperties||{},void 0!==t&&(e.data.hProperties.rowSpan=t,delete e.data.rowspan),void 0!==r&&(e.data.hProperties.colSpan=r,delete e.data.colspan)}})}},F=require("unist-util-visit");var M={name:"extract-code-meta",stage:"normalize",order:30,transform:async e=>{(0,F.visit)(e,"code",e=>{if(e.meta){const t=function(e){const t={},r=/([a-zA-Z0-9_-]+)(?:=?(?:"([^"]*)"|'([^']*)'|([^ \t\n\r\f]+)))?/g;let i;for(;null!==(i=r.exec(e));){const e=i[1],r=i[2]||i[3]||i[4]||"";t[e]=r}return t}(e.meta),r=e.data=e.data||{};t.title&&(r.title=t.title),t.filename&&(r.filename=t.filename),r.kv={...r.kv||{},...t}}})}},N=require("unist-util-visit"),_={name:"image-size",stage:"normalize",order:40,transform:async e=>{(0,N.visit)(e,"image",e=>{const t=e.data=e.data||{},r=t.hProperties=t.hProperties||{},i=/[#?&](?:width=([0-9]+))?(?:&?height=([0-9]+))?(?:=([0-9]+)x([0-9]+))?$/,n=e.url.match(i);if(n){const t=n[1]||n[3],a=n[2]||n[4];t&&!r.width&&(r.width=parseInt(t,10)),a&&!r.height&&(r.height=parseInt(a,10)),e.url=e.url.replace(i,"")}t.width&&!r.width&&(r.width=t.width),t.height&&!r.height&&(r.height=t.height)})}},I=require("unist-util-visit");function L(e,t){return{type:e,children:t,data:{hName:e}}}var T={name:"normalize-inline-styles",stage:"normalize",transform:e=>{!function(e){(0,I.visit)(e,"text",(e,t,r)=>{if(!r||void 0===t)return;let i=e.value,n=0;const a=[];let s=!1;const o=/(==[^=]+==|~[^~]+~|\^[^^]+\^)/g;let u;for(;null!==(u=o.exec(i));){s=!0;const e=u[0],t=u.index;t>n&&a.push({type:"text",value:i.slice(n,t)});let r="mark",l="";e.startsWith("==")?(r="mark",l=e.slice(2,-2)):e.startsWith("~")?(r="sub",l=e.slice(1,-1)):e.startsWith("^")&&(r="sup",l=e.slice(1,-1)),a.push(L(r,[{type:"text",value:l}])),n=o.lastIndex}return s?(n<i.length&&a.push({type:"text",value:i.slice(n)}),r.children.splice(t,1,...a),t+a.length):void 0})}(e)}},A=class e{constructor(e){this.inputFormat="markdown",this.plugins=[],this.globalData={},this.input=e,this.processor=(0,c.unified)(),this.use(O),this.use(D),this.use(M),this.use(_),this.use(T)}static registerFormat(t,r){e.formats[t.toLowerCase()]=r}from(e){return this.inputFormat=e.toLowerCase(),this}use(e){return this.plugins.push(e),this}data(e){return this.globalData={...this.globalData,...e},this}async to(t){t=t.toLowerCase();const r=e.formats[this.inputFormat];r?.parse&&r.parse(this.processor);let i="string"==typeof this.input?this.processor.parse(this.input):this.input;i.data={...i.data,...this.globalData};const n=[...this.plugins].sort((e,t)=>{const r={normalize:0,compile:1,finalize:2},i=e.stage||"normalize",n=t.stage||"normalize";return i!==n?r[i]-r[n]:(e.order||0)-(t.order||0)});for(const e of n)await e.transform(i,this.processor);const a=(0,c.unified)().data("settings",this.processor.data("settings")),s=e.formats[t];s?.stringify&&s.stringify(a),"markdown"!==t||s||a.use(h.default).use(w);const o=await a.run(i),u=a.stringify(o),l=[];return i.data&&i.data.assets&&l.push(...i.data.assets),{content:u,assets:l}}async toMarkdown(){return(await this.to("markdown")).content}async toHTML(){return(await this.to("html")).content}};A.formats={markdown:{parse:e=>e.use(m.default).use(w),stringify:e=>e.use(h.default).use(w)},html:{parse:e=>e.use(f.default).use(d.default),stringify:e=>e.use(z)},ast:{parse:e=>{}}};var B=A;function C(e){return new B(e)}
1
+ "use strict";var t,e=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(t,e,s,o)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let u of n(e))a.call(t,u)||u===s||r(t,u,{get:()=>e[u],enumerable:!(o=i(e,u))||o.enumerable});return t},u=(t,i,n)=>(n=null!=t?e(s(t)):{},o(!i&&t&&t.__esModule?n:r(n,"default",{value:t,enumerable:!0}),t)),c={};((t,e)=>{for(var i in e)r(t,i,{get:e[i],enumerable:!0})})(c,{FluentProcessor:()=>P,htmlFormat:()=>F,htmlStringify:()=>D,markdownCommon:()=>q,markdownFormat:()=>z,mdast:()=>$}),module.exports=(t=c,o(r({},"__esModule",{value:!0}),t));var l=require("unified"),m=u(require("remark-parse")),h=u(require("remark-stringify")),f=u(require("remark-gfm")),p=u(require("remark-directive")),d=u(require("remark-math")),y=u(require("remark-frontmatter")),v=require("unist-util-visit");function g(t,e){return{type:t,children:e,data:{hName:t}}}var w={mark:(t,e)=>{const r={type:"mark",children:t.all(e)};return t.patch(e,r),r},sub:(t,e)=>{const r={type:"sub",children:t.all(e)};return t.patch(e,r),r},sup:(t,e)=>{const r={type:"sup",children:t.all(e)};return t.patch(e,r),r}},b={mark:(t,e,r)=>"=="+r.containerPhrasing(t,{before:"==",after:"=="})+"==",sub:(t,e,r)=>"~"+r.containerPhrasing(t,{before:"~",after:"~"})+"~",sup:(t,e,r)=>"^"+r.containerPhrasing(t,{before:"^",after:"^"})+"^"},k={name:"normalize-inline-styles",stage:"normalize",transform:t=>{!function(t){(0,v.visit)(t,"text",(t,e,r)=>{if(!r||void 0===e)return;const i=t.value;let n=0;const s=[];let a=!1;const o=/(==[^=]+==|~[^~]+~|\^[^^]+\^)/g;let u;for(;null!==(u=o.exec(i));){a=!0;const t=u[0],e=u.index;e>n&&s.push({type:"text",value:i.slice(n,e)});let r="mark",c="";t.startsWith("==")?(r="mark",c=t.slice(2,-2)):t.startsWith("~")?(r="sub",c=t.slice(1,-1)):t.startsWith("^")&&(r="sup",c=t.slice(1,-1)),s.push(g(r,[{type:"text",value:c}])),n=o.lastIndex}return a?(n<i.length&&s.push({type:"text",value:i.slice(n)}),r.children.splice(e,1,...s),e+s.length):void 0})}(t)}};function q(){const t=this.data();var e,r;r={handlers:b},t[e="toMarkdownExtensions"]?t[e].push(r):t[e]=[r],this.use(f.default,{singleTilde:!1}).use(p.default).use(d.default).use(y.default,["yaml","toml"])}var z={parse:t=>t.use(m.default).use(q),stringify:t=>t.use(h.default).use(q)},x=u(require("rehype-parse")),S=u(require("rehype-remark")),j=u(require("remark-rehype")),O=u(require("rehype-sanitize")),N=u(require("rehype-stringify"));function D(){this.use(j.default).use(O.default,{...O.defaultSchema,tagNames:[...O.defaultSchema.tagNames||[],"mark","sub","sup"],attributes:{...O.defaultSchema.attributes,"*":[...O.defaultSchema.attributes?.["*"]||[],"className","id","style"],td:[...O.defaultSchema.attributes?.td||[],"rowSpan","colSpan","rowspan","colspan"],th:[...O.defaultSchema.attributes?.th||[],"rowSpan","colSpan","rowspan","colspan"],img:[...O.defaultSchema.attributes?.img||[],"width","height"]}}).use(N.default)}var F={parse:t=>t.use(x.default).use(S.default,{handlers:w}),stringify:t=>t.use(D)},M=require("unist-util-visit"),T={error:"danger",warn:"warning",success:"tip",important:"important",caution:"caution",note:"note"},C={name:"normalize-directive",stage:"normalize",order:10,transform:async t=>{(0,M.visit)(t,["containerDirective","leafDirective","textDirective"],t=>{const e=t,r=e.name.toLowerCase();if(e.name=T[r]||r,e.children&&e.children.length>0){const t=e.children[0];if(t.data?.directiveLabel||"directiveLabel"===t.type){const r=t;let i="";(0,M.visit)(r,"text",t=>{i+=t.value}),i&&!e.attributes?.title&&(e.attributes=e.attributes||{},e.attributes.title=i.trim()),e.children.shift()}}e.attributes?.title&&(e.attributes.title=String(e.attributes.title).trim()),e.data=e.data||{},e.data.hName=e.data.hName||("containerDirective"===e.type?"div":"span"),e.data.hProperties={...e.data.hProperties||{},...e.attributes,className:[e.name,e.data.hProperties?.className].filter(Boolean).join(" ")}})}},I=require("unist-util-visit"),L={name:"normalize-table-span",stage:"normalize",order:20,transform:async t=>{(0,I.visit)(t,"tableCell",t=>{if(t.data){const{rowspan:e,colspan:r}=t.data;t.data.hProperties=t.data.hProperties||{},void 0!==e&&(t.data.hProperties.rowSpan=e,delete t.data.rowspan),void 0!==r&&(t.data.hProperties.colSpan=r,delete t.data.colspan)}})}},_=require("unist-util-visit"),A=require("shell-quote");var B={name:"extract-code-meta",stage:"normalize",order:30,transform:async t=>{(0,_.visit)(t,"code",t=>{if(t.meta){const e=function(t){const e={},r=(0,A.parse)(t);for(const t of r)if("string"==typeof t){const r=t.split("=",2);2===r.length?e[r[0]]=r[1]:e[t]="true"}return e}(t.meta),r=t.data=t.data||{};e.title&&(r.title=e.title),e.filename&&(r.filename=e.filename),r.kv={...r.kv||{},...e}}})}},E=require("unist-util-visit"),H={name:"image-size",stage:"normalize",order:40,transform:async t=>{(0,E.visit)(t,"image",t=>{const e=t.data=t.data||{},r=e.hProperties=e.hProperties||{},i=/[#?&](?:width=([0-9]+))?(?:&?height=([0-9]+))?(?:=([0-9]+)x([0-9]+))?$/,n=t.url.match(i);if(n){const e=n[1]||n[3],s=n[2]||n[4];e&&!r.width&&(r.width=parseInt(e,10)),s&&!r.height&&(r.height=parseInt(s,10)),t.url=t.url.replace(i,"")}e.width&&!r.width&&(r.width=e.width),e.height&&!r.height&&(r.height=e.height)})}},J=class t{constructor(t){this.inputFormat="markdown",this.plugins=[],this.globalData={},this.input=t,this.processor=(0,l.unified)(),this.use(C),this.use(L),this.use(B),this.use(H),this.use(k)}static registerFormat(e,r){t.formats[e.toLowerCase()]=r}from(t){return this.inputFormat=t.toLowerCase(),this}use(t){return this.plugins.push(t),this}data(t){return this.globalData={...this.globalData,...t},this}async to(e){e=e.toLowerCase();const r=t.formats[this.inputFormat];r?.parse&&r.parse(this.processor);let i="string"==typeof this.input?this.processor.parse(this.input):this.input;i=await this.processor.run(i),i.data={...i.data,...this.globalData};const n=[...this.plugins].sort((t,e)=>{const r={normalize:0,compile:1,finalize:2},i=t.stage||"normalize",n=e.stage||"normalize";return i!==n?r[i]-r[n]:(t.order||0)-(e.order||0)});for(const t of n)await t.transform(i,this.processor);const s=(0,l.unified)().data("settings",this.processor.data("settings")),a=t.formats[e];a?.stringify&&a.stringify(s),"markdown"!==e||a||z.stringify(s);const o=await s.run(i),u=s.stringify(o),c=[];return i.data&&i.data.assets&&c.push(...i.data.assets),{content:u,assets:c}}async toMarkdown(){return(await this.to("markdown")).content}async toHTML(){return(await this.to("html")).content}async toAST(){return(await this.to("ast")).content}};J.formats={markdown:z,html:F,ast:{parse:t=>{t.Parser=t=>JSON.parse(t)},stringify:t=>{t.Compiler=t=>t}}};var P=J;function $(t){return new P(t)}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{unified as t}from"unified";import r from"remark-parse";import i from"remark-stringify";import e from"rehype-parse";import s from"rehype-remark";import a from"remark-gfm";import n from"remark-directive";import o from"remark-math";import m from"remark-frontmatter";function c(){const t=this.data();var r,i;i={handlers:{mark:(t,r,i)=>"=="+i.containerPhrasing(t,{before:"==",after:"=="})+"==",sub:(t,r,i)=>"~"+i.containerPhrasing(t,{before:"~",after:"~"})+"~",sup:(t,r,i)=>"^"+i.containerPhrasing(t,{before:"^",after:"^"})+"^"}},t[r="toMarkdownExtensions"]?t[r].push(i):t[r]=[i],this.use(a,{singleTilde:!1}).use(n).use(o).use(m,["yaml","toml"])}import l from"remark-rehype";import f,{defaultSchema as p}from"rehype-sanitize";import h from"rehype-stringify";function u(){this.use(l).use(f,{...p,tagNames:[...p.tagNames||[],"mark","sub","sup"],attributes:{...p.attributes,"*":[...p.attributes?.["*"]||[],"className","id","style"],td:[...p.attributes?.td||[],"rowSpan","colSpan","rowspan","colspan"],th:[...p.attributes?.th||[],"rowSpan","colSpan","rowspan","colspan"],img:[...p.attributes?.img||[],"width","height"]}}).use(h)}import{visit as d}from"unist-util-visit";var v={error:"danger",warn:"warning",success:"tip",important:"important",caution:"caution",note:"note"},g={name:"normalize-directive",stage:"normalize",order:10,transform:async t=>{d(t,["containerDirective","leafDirective","textDirective"],t=>{const r=t,i=r.name.toLowerCase();if(r.name=v[i]||i,r.children&&r.children.length>0){const t=r.children[0];if(t.data?.directiveLabel||"directiveLabel"===t.type){let i="";d(t,"text",t=>{i+=t.value}),i&&!r.attributes?.title&&(r.attributes=r.attributes||{},r.attributes.title=i.trim()),r.children.shift()}}r.attributes?.title&&(r.attributes.title=String(r.attributes.title).trim()),r.data=r.data||{},r.data.hName=r.data.hName||("containerDirective"===r.type?"div":"span"),r.data.hProperties={...r.data.hProperties||{},...r.attributes,className:[r.name,r.data.hProperties?.className].filter(Boolean).join(" ")}})}};import{visit as y}from"unist-util-visit";var w={name:"normalize-table-span",stage:"normalize",order:20,transform:async t=>{y(t,"tableCell",t=>{if(t.data){const{rowspan:r,colspan:i}=t.data;t.data.hProperties=t.data.hProperties||{},void 0!==r&&(t.data.hProperties.rowSpan=r,delete t.data.rowspan),void 0!==i&&(t.data.hProperties.colSpan=i,delete t.data.colspan)}})}};import{visit as k}from"unist-util-visit";var z={name:"extract-code-meta",stage:"normalize",order:30,transform:async t=>{k(t,"code",t=>{if(t.meta){const r=function(t){const r={},i=/([a-zA-Z0-9_-]+)(?:=?(?:"([^"]*)"|'([^']*)'|([^ \t\n\r\f]+)))?/g;let e;for(;null!==(e=i.exec(t));){const t=e[1],i=e[2]||e[3]||e[4]||"";r[t]=i}return r}(t.meta),i=t.data=t.data||{};r.title&&(i.title=r.title),r.filename&&(i.filename=r.filename),i.kv={...i.kv||{},...r}}})}};import{visit as b}from"unist-util-visit";var x={name:"image-size",stage:"normalize",order:40,transform:async t=>{b(t,"image",t=>{const r=t.data=t.data||{},i=r.hProperties=r.hProperties||{},e=/[#?&](?:width=([0-9]+))?(?:&?height=([0-9]+))?(?:=([0-9]+)x([0-9]+))?$/,s=t.url.match(e);if(s){const r=s[1]||s[3],a=s[2]||s[4];r&&!i.width&&(i.width=parseInt(r,10)),a&&!i.height&&(i.height=parseInt(a,10)),t.url=t.url.replace(e,"")}r.width&&!i.width&&(i.width=r.width),r.height&&!i.height&&(i.height=r.height)})}};import{visit as S}from"unist-util-visit";function D(t,r){return{type:t,children:r,data:{hName:t}}}var N={name:"normalize-inline-styles",stage:"normalize",transform:t=>{!function(t){S(t,"text",(t,r,i)=>{if(!i||void 0===r)return;let e=t.value,s=0;const a=[];let n=!1;const o=/(==[^=]+==|~[^~]+~|\^[^^]+\^)/g;let m;for(;null!==(m=o.exec(e));){n=!0;const t=m[0],r=m.index;r>s&&a.push({type:"text",value:e.slice(s,r)});let i="mark",c="";t.startsWith("==")?(i="mark",c=t.slice(2,-2)):t.startsWith("~")?(i="sub",c=t.slice(1,-1)):t.startsWith("^")&&(i="sup",c=t.slice(1,-1)),a.push(D(i,[{type:"text",value:c}])),s=o.lastIndex}return n?(s<e.length&&a.push({type:"text",value:e.slice(s)}),i.children.splice(r,1,...a),r+a.length):void 0})}(t)}},M=class r{constructor(r){this.inputFormat="markdown",this.plugins=[],this.globalData={},this.input=r,this.processor=t(),this.use(g),this.use(w),this.use(z),this.use(x),this.use(N)}static registerFormat(t,i){r.formats[t.toLowerCase()]=i}from(t){return this.inputFormat=t.toLowerCase(),this}use(t){return this.plugins.push(t),this}data(t){return this.globalData={...this.globalData,...t},this}async to(e){e=e.toLowerCase();const s=r.formats[this.inputFormat];s?.parse&&s.parse(this.processor);let a="string"==typeof this.input?this.processor.parse(this.input):this.input;a.data={...a.data,...this.globalData};const n=[...this.plugins].sort((t,r)=>{const i={normalize:0,compile:1,finalize:2},e=t.stage||"normalize",s=r.stage||"normalize";return e!==s?i[e]-i[s]:(t.order||0)-(r.order||0)});for(const t of n)await t.transform(a,this.processor);const o=t().data("settings",this.processor.data("settings")),m=r.formats[e];m?.stringify&&m.stringify(o),"markdown"!==e||m||o.use(i).use(c);const l=await o.run(a),f=o.stringify(l),p=[];return a.data&&a.data.assets&&p.push(...a.data.assets),{content:f,assets:p}}async toMarkdown(){return(await this.to("markdown")).content}async toHTML(){return(await this.to("html")).content}};M.formats={markdown:{parse:t=>t.use(r).use(c),stringify:t=>t.use(i).use(c)},html:{parse:t=>t.use(e).use(s),stringify:t=>t.use(u)},ast:{parse:t=>{}}};var I=M;function L(t){return new I(t)}export{I as FluentProcessor,u as htmlFormat,c as markdownFormat,L as mdast};
1
+ import{unified as t}from"unified";import r from"remark-parse";import i from"remark-stringify";import e from"remark-gfm";import s from"remark-directive";import n from"remark-math";import a from"remark-frontmatter";import{visit as o}from"unist-util-visit";function m(t,r){return{type:t,children:r,data:{hName:t}}}var c={mark:(t,r)=>{const i={type:"mark",children:t.all(r)};return t.patch(r,i),i},sub:(t,r)=>{const i={type:"sub",children:t.all(r)};return t.patch(r,i),i},sup:(t,r)=>{const i={type:"sup",children:t.all(r)};return t.patch(r,i),i}},l={mark:(t,r,i)=>"=="+i.containerPhrasing(t,{before:"==",after:"=="})+"==",sub:(t,r,i)=>"~"+i.containerPhrasing(t,{before:"~",after:"~"})+"~",sup:(t,r,i)=>"^"+i.containerPhrasing(t,{before:"^",after:"^"})+"^"},p={name:"normalize-inline-styles",stage:"normalize",transform:t=>{!function(t){o(t,"text",(t,r,i)=>{if(!i||void 0===r)return;const e=t.value;let s=0;const n=[];let a=!1;const o=/(==[^=]+==|~[^~]+~|\^[^^]+\^)/g;let c;for(;null!==(c=o.exec(e));){a=!0;const t=c[0],r=c.index;r>s&&n.push({type:"text",value:e.slice(s,r)});let i="mark",l="";t.startsWith("==")?(i="mark",l=t.slice(2,-2)):t.startsWith("~")?(i="sub",l=t.slice(1,-1)):t.startsWith("^")&&(i="sup",l=t.slice(1,-1)),n.push(m(i,[{type:"text",value:l}])),s=o.lastIndex}return a?(s<e.length&&n.push({type:"text",value:e.slice(s)}),i.children.splice(r,1,...n),r+n.length):void 0})}(t)}};function f(){const t=this.data();var r,i;i={handlers:l},t[r="toMarkdownExtensions"]?t[r].push(i):t[r]=[i],this.use(e,{singleTilde:!1}).use(s).use(n).use(a,["yaml","toml"])}var h={parse:t=>t.use(r).use(f),stringify:t=>t.use(i).use(f)};import u from"rehype-parse";import d from"rehype-remark";import v from"remark-rehype";import y,{defaultSchema as g}from"rehype-sanitize";import w from"rehype-stringify";function k(){this.use(v).use(y,{...g,tagNames:[...g.tagNames||[],"mark","sub","sup"],attributes:{...g.attributes,"*":[...g.attributes?.["*"]||[],"className","id","style"],td:[...g.attributes?.td||[],"rowSpan","colSpan","rowspan","colspan"],th:[...g.attributes?.th||[],"rowSpan","colSpan","rowspan","colspan"],img:[...g.attributes?.img||[],"width","height"]}}).use(w)}var z={parse:t=>t.use(u).use(d,{handlers:c}),stringify:t=>t.use(k)};import{visit as b}from"unist-util-visit";var x={error:"danger",warn:"warning",success:"tip",important:"important",caution:"caution",note:"note"},S={name:"normalize-directive",stage:"normalize",order:10,transform:async t=>{b(t,["containerDirective","leafDirective","textDirective"],t=>{const r=t,i=r.name.toLowerCase();if(r.name=x[i]||i,r.children&&r.children.length>0){const t=r.children[0];if(t.data?.directiveLabel||"directiveLabel"===t.type){let i="";b(t,"text",t=>{i+=t.value}),i&&!r.attributes?.title&&(r.attributes=r.attributes||{},r.attributes.title=i.trim()),r.children.shift()}}r.attributes?.title&&(r.attributes.title=String(r.attributes.title).trim()),r.data=r.data||{},r.data.hName=r.data.hName||("containerDirective"===r.type?"div":"span"),r.data.hProperties={...r.data.hProperties||{},...r.attributes,className:[r.name,r.data.hProperties?.className].filter(Boolean).join(" ")}})}};import{visit as N}from"unist-util-visit";var D={name:"normalize-table-span",stage:"normalize",order:20,transform:async t=>{N(t,"tableCell",t=>{if(t.data){const{rowspan:r,colspan:i}=t.data;t.data.hProperties=t.data.hProperties||{},void 0!==r&&(t.data.hProperties.rowSpan=r,delete t.data.rowspan),void 0!==i&&(t.data.hProperties.colSpan=i,delete t.data.colspan)}})}};import{visit as M}from"unist-util-visit";import{parse as T}from"shell-quote";var I={name:"extract-code-meta",stage:"normalize",order:30,transform:async t=>{M(t,"code",t=>{if(t.meta){const r=function(t){const r={},i=T(t);for(const t of i)if("string"==typeof t){const i=t.split("=",2);2===i.length?r[i[0]]=i[1]:r[t]="true"}return r}(t.meta),i=t.data=t.data||{};r.title&&(i.title=r.title),r.filename&&(i.filename=r.filename),i.kv={...i.kv||{},...r}}})}};import{visit as L}from"unist-util-visit";var q={name:"image-size",stage:"normalize",order:40,transform:async t=>{L(t,"image",t=>{const r=t.data=t.data||{},i=r.hProperties=r.hProperties||{},e=/[#?&](?:width=([0-9]+))?(?:&?height=([0-9]+))?(?:=([0-9]+)x([0-9]+))?$/,s=t.url.match(e);if(s){const r=s[1]||s[3],n=s[2]||s[4];r&&!i.width&&(i.width=parseInt(r,10)),n&&!i.height&&(i.height=parseInt(n,10)),t.url=t.url.replace(e,"")}r.width&&!i.width&&(i.width=r.width),r.height&&!i.height&&(i.height=r.height)})}},A=class r{constructor(r){this.inputFormat="markdown",this.plugins=[],this.globalData={},this.input=r,this.processor=t(),this.use(S),this.use(D),this.use(I),this.use(q),this.use(p)}static registerFormat(t,i){r.formats[t.toLowerCase()]=i}from(t){return this.inputFormat=t.toLowerCase(),this}use(t){return this.plugins.push(t),this}data(t){return this.globalData={...this.globalData,...t},this}async to(i){i=i.toLowerCase();const e=r.formats[this.inputFormat];e?.parse&&e.parse(this.processor);let s="string"==typeof this.input?this.processor.parse(this.input):this.input;s=await this.processor.run(s),s.data={...s.data,...this.globalData};const n=[...this.plugins].sort((t,r)=>{const i={normalize:0,compile:1,finalize:2},e=t.stage||"normalize",s=r.stage||"normalize";return e!==s?i[e]-i[s]:(t.order||0)-(r.order||0)});for(const t of n)await t.transform(s,this.processor);const a=t().data("settings",this.processor.data("settings")),o=r.formats[i];o?.stringify&&o.stringify(a),"markdown"!==i||o||h.stringify(a);const m=await a.run(s),c=a.stringify(m),l=[];return s.data&&s.data.assets&&l.push(...s.data.assets),{content:c,assets:l}}async toMarkdown(){return(await this.to("markdown")).content}async toHTML(){return(await this.to("html")).content}async toAST(){return(await this.to("ast")).content}};A.formats={markdown:h,html:z,ast:{parse:t=>{t.Parser=t=>JSON.parse(t)},stringify:t=>{t.Compiler=t=>t}}};var B=A;function C(t){return new B(t)}export{B as FluentProcessor,z as htmlFormat,k as htmlStringify,f as markdownCommon,h as markdownFormat,C as mdast};
package/docs/README.md CHANGED
@@ -21,6 +21,7 @@ English | [简体中文](_media/README.cn.md) | [GitHub](https://github.com/isdk
21
21
  - **Table Spans**: Support for `rowspan` and `colspan` in HTML output.
22
22
  - **Code Meta**: Structured parsing of code block metadata strings.
23
23
  - **Image Sizing**: URL "sugar" support (e.g., `image.png#=500x300`) for image dimensions.
24
+ - **Inline Styles**: Built-in support for `==Highlight==`, `~Subscript~`, and `^Superscript^`.
24
25
  - **Deeply Typed**: Built on TypeScript with full support for unist/mdast module augmentation.
25
26
 
26
27
  ## Installation
@@ -50,6 +51,13 @@ const html = await mdast('![Cat](cat.png#=500x300)').toHTML();
50
51
  // Result: <img src="cat.png" alt="Cat" width="500" height="300">
51
52
  ```
52
53
 
54
+ ### AST Output
55
+
56
+ ```typescript
57
+ const ast = await mdast('==Highlighted==').toAST();
58
+ // Returns the mdast Root object
59
+ ```
60
+
53
61
  ### Advanced Pipeline
54
62
 
55
63
  ```typescript
@@ -103,6 +111,7 @@ Plugins are executed based on their `stage` and `order`:
103
111
  | `normalize-table-span` | normalize | Migrates table cell spans to `hProperties`. |
104
112
  | `extract-code-meta` | normalize | Parses `title="foo"` from code block meta. |
105
113
  | `image-size` | normalize | Parses `#=WxH` from image URLs. |
114
+ | `normalize-inline-styles` | normalize | Standardizes `==mark==`, `~sub~`, and `^sup^`. |
106
115
 
107
116
  ## Contributing
108
117
 
@@ -17,6 +17,7 @@
17
17
  - **表格跨行/跨列**: 支持 HTML 输出中的 `rowspan` 和 `colspan`。
18
18
  - **代码元数据**: 对代码块元数据字符串进行结构化解析。
19
19
  - **图片尺寸**: 支持 URL 糖语法 (例如 `image.png#=500x300`) 来设置图片尺寸。
20
+ - **行内样式**: 内置对 `==高亮==`、`~下标~` 和 `^上标^` 的支持。
20
21
  - **深度类型支持**: 基于 TypeScript 构建,完整支持 unist/mdast 的模块扩充。
21
22
 
22
23
  ## 安装
@@ -46,6 +47,13 @@ const html = await mdast('![Cat](cat.png#=500x300)').toHTML();
46
47
  // 结果: <img src="cat.png" alt="Cat" width="500" height="300">
47
48
  ```
48
49
 
50
+ ### AST 输出
51
+
52
+ ```typescript
53
+ const ast = await mdast('==高亮内容==').toAST();
54
+ // 返回 mdast Root 对象
55
+ ```
56
+
49
57
  ### 高级工作流
50
58
 
51
59
  ```typescript
@@ -99,6 +107,7 @@ const result = await mdast('Hello').to('reverse');
99
107
  | `normalize-table-span` | normalize | 将表格单元格跨度迁移到 `hProperties`。 |
100
108
  | `extract-code-meta` | normalize | 从代码块元数据中解析 `title="foo"`。 |
101
109
  | `image-size` | normalize | 从图片 URL 中解析 `#=WxH`。 |
110
+ | `normalize-inline-styles` | normalize | 标准化 `==mark==`、`~sub~` 和 `^sup^`。 |
102
111
 
103
112
  ## 贡献
104
113
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: FluentProcessor
8
8
 
9
- Defined in: [packages/mdast-plus/src/pipeline.ts:24](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L24)
9
+ Defined in: [packages/mdast-plus/src/pipeline.ts:20](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L20)
10
10
 
11
11
  Fluent processor for mdast transformations.
12
12
  Allows chaining configuration and finally converting to a target format.
@@ -17,7 +17,7 @@ Allows chaining configuration and finally converting to a target format.
17
17
 
18
18
  > **new FluentProcessor**(`input`): `FluentProcessor`
19
19
 
20
- Defined in: [packages/mdast-plus/src/pipeline.ts:59](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L59)
20
+ Defined in: [packages/mdast-plus/src/pipeline.ts:54](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L54)
21
21
 
22
22
  Creates a new FluentProcessor instance.
23
23
 
@@ -39,7 +39,7 @@ The input content (string or mdast tree)
39
39
 
40
40
  > `static` **formats**: `Record`\<`string`, [`MdastFormatDefinition`](../interfaces/MdastFormatDefinition.md)\>
41
41
 
42
- Defined in: [packages/mdast-plus/src/pipeline.ts:26](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L26)
42
+ Defined in: [packages/mdast-plus/src/pipeline.ts:22](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L22)
43
43
 
44
44
  Map of registered format definitions
45
45
 
@@ -49,7 +49,7 @@ Map of registered format definitions
49
49
 
50
50
  > **data**(`data`): `this`
51
51
 
52
- Defined in: [packages/mdast-plus/src/pipeline.ts:93](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L93)
52
+ Defined in: [packages/mdast-plus/src/pipeline.ts:88](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L88)
53
53
 
54
54
  Merges global data into the processor.
55
55
 
@@ -71,7 +71,7 @@ Key-value pairs to store in global data
71
71
 
72
72
  > **from**(`format`): `this`
73
73
 
74
- Defined in: [packages/mdast-plus/src/pipeline.ts:75](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L75)
74
+ Defined in: [packages/mdast-plus/src/pipeline.ts:70](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L70)
75
75
 
76
76
  Specifies the input format.
77
77
 
@@ -93,7 +93,7 @@ The input format name (default: 'markdown')
93
93
 
94
94
  > **to**(`format`): `Promise`\<[`ConvertResult`](../interfaces/ConvertResult.md)\<`string`\>\>
95
95
 
96
- Defined in: [packages/mdast-plus/src/pipeline.ts:103](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L103)
96
+ Defined in: [packages/mdast-plus/src/pipeline.ts:98](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L98)
97
97
 
98
98
  Converts the input content to the specified format.
99
99
 
@@ -113,11 +113,27 @@ A promise resolving to the conversion result (content and assets)
113
113
 
114
114
  ***
115
115
 
116
+ ### toAST()
117
+
118
+ > **toAST**(): `Promise`\<`Root`\>
119
+
120
+ Defined in: [packages/mdast-plus/src/pipeline.ts:180](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L180)
121
+
122
+ Helper to get the processed mdast tree.
123
+
124
+ #### Returns
125
+
126
+ `Promise`\<`Root`\>
127
+
128
+ A promise resolving to the mdast Root node
129
+
130
+ ***
131
+
116
132
  ### toHTML()
117
133
 
118
134
  > **toHTML**(): `Promise`\<`string`\>
119
135
 
120
- Defined in: [packages/mdast-plus/src/pipeline.ts:173](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L173)
136
+ Defined in: [packages/mdast-plus/src/pipeline.ts:171](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L171)
121
137
 
122
138
  Helper to convert content to HTML.
123
139
 
@@ -133,7 +149,7 @@ A promise resolving to the HTML string
133
149
 
134
150
  > **toMarkdown**(): `Promise`\<`string`\>
135
151
 
136
- Defined in: [packages/mdast-plus/src/pipeline.ts:164](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L164)
152
+ Defined in: [packages/mdast-plus/src/pipeline.ts:162](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L162)
137
153
 
138
154
  Helper to convert content to Markdown.
139
155
 
@@ -149,7 +165,7 @@ A promise resolving to the Markdown string
149
165
 
150
166
  > **use**(`plugin`): `this`
151
167
 
152
- Defined in: [packages/mdast-plus/src/pipeline.ts:84](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L84)
168
+ Defined in: [packages/mdast-plus/src/pipeline.ts:79](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L79)
153
169
 
154
170
  Adds a plugin to the processing pipeline.
155
171
 
@@ -171,7 +187,7 @@ The mdast plugin to use
171
187
 
172
188
  > `static` **registerFormat**(`name`, `definition`): `void`
173
189
 
174
- Defined in: [packages/mdast-plus/src/pipeline.ts:45](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L45)
190
+ Defined in: [packages/mdast-plus/src/pipeline.ts:40](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L40)
175
191
 
176
192
  Registers a new format definition.
177
193
 
@@ -0,0 +1,23 @@
1
+ [**@isdk/mdast-plus**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/mdast-plus](../globals.md) / htmlStringify
6
+
7
+ # Function: htmlStringify()
8
+
9
+ > **htmlStringify**(`this`): `void`
10
+
11
+ Defined in: [packages/mdast-plus/src/formats/html.ts:12](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/formats/html.ts#L12)
12
+
13
+ Standard compiler/stringifier for HTML.
14
+
15
+ ## Parameters
16
+
17
+ ### this
18
+
19
+ `any`
20
+
21
+ ## Returns
22
+
23
+ `void`
@@ -0,0 +1,23 @@
1
+ [**@isdk/mdast-plus**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/mdast-plus](../globals.md) / markdownCommon
6
+
7
+ # Function: markdownCommon()
8
+
9
+ > **markdownCommon**(`this`): `void`
10
+
11
+ Defined in: [packages/mdast-plus/src/formats/markdown.ts:13](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/formats/markdown.ts#L13)
12
+
13
+ Common remark configuration for Markdown.
14
+
15
+ ## Parameters
16
+
17
+ ### this
18
+
19
+ `any`
20
+
21
+ ## Returns
22
+
23
+ `void`
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **mdast**(`input`): [`FluentProcessor`](../classes/FluentProcessor.md)
10
10
 
11
- Defined in: [packages/mdast-plus/src/pipeline.ts:184](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/pipeline.ts#L184)
11
+ Defined in: [packages/mdast-plus/src/pipeline.ts:191](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/pipeline.ts#L191)
12
12
 
13
13
  Entry point for the fluent mdast-plus API.
14
14
 
package/docs/globals.md CHANGED
@@ -26,8 +26,13 @@
26
26
 
27
27
  - [Stage](type-aliases/Stage.md)
28
28
 
29
+ ## Variables
30
+
31
+ - [htmlFormat](variables/htmlFormat.md)
32
+ - [markdownFormat](variables/markdownFormat.md)
33
+
29
34
  ## Functions
30
35
 
31
- - [htmlFormat](functions/htmlFormat.md)
32
- - [markdownFormat](functions/markdownFormat.md)
36
+ - [htmlStringify](functions/htmlStringify.md)
37
+ - [markdownCommon](functions/markdownCommon.md)
33
38
  - [mdast](functions/mdast.md)
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: ConvertResult\<T\>
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L50)
9
+ Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L50)
10
10
 
11
11
  Result of a conversion process.
12
12
 
@@ -24,7 +24,7 @@ The type of the main content (default: string)
24
24
 
25
25
  > **assets**: [`MdastAsset`](MdastAsset.md)[]
26
26
 
27
- Defined in: [packages/mdast-plus/src/types.ts:54](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L54)
27
+ Defined in: [packages/mdast-plus/src/types.ts:54](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L54)
28
28
 
29
29
  Extracted assets
30
30
 
@@ -34,6 +34,6 @@ Extracted assets
34
34
 
35
35
  > **content**: `T`
36
36
 
37
- Defined in: [packages/mdast-plus/src/types.ts:52](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L52)
37
+ Defined in: [packages/mdast-plus/src/types.ts:52](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L52)
38
38
 
39
39
  The converted content
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastAsset
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:37](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L37)
9
+ Defined in: [packages/mdast-plus/src/types.ts:37](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L37)
10
10
 
11
11
  Represents an asset (e.g., image) extracted during processing.
12
12
 
@@ -16,7 +16,7 @@ Represents an asset (e.g., image) extracted during processing.
16
16
 
17
17
  > **bytes**: `Uint8Array`
18
18
 
19
- Defined in: [packages/mdast-plus/src/types.ts:43](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L43)
19
+ Defined in: [packages/mdast-plus/src/types.ts:43](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L43)
20
20
 
21
21
  Raw content as bytes
22
22
 
@@ -26,7 +26,7 @@ Raw content as bytes
26
26
 
27
27
  > **contentType**: `string`
28
28
 
29
- Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L41)
29
+ Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L41)
30
30
 
31
31
  MIME type of the asset
32
32
 
@@ -36,6 +36,6 @@ MIME type of the asset
36
36
 
37
37
  > **path**: `string`
38
38
 
39
- Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L39)
39
+ Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L39)
40
40
 
41
41
  Relative path or identifier for the asset
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastDataOrigin
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:60](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L60)
9
+ Defined in: [packages/mdast-plus/src/types.ts:60](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L60)
10
10
 
11
11
  Original metadata for a node.
12
12
 
@@ -20,7 +20,7 @@ Original metadata for a node.
20
20
 
21
21
  > **format**: `string`
22
22
 
23
- Defined in: [packages/mdast-plus/src/types.ts:62](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L62)
23
+ Defined in: [packages/mdast-plus/src/types.ts:62](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L62)
24
24
 
25
25
  Source format
26
26
 
@@ -30,7 +30,7 @@ Source format
30
30
 
31
31
  > `optional` **hash**: `string`
32
32
 
33
- Defined in: [packages/mdast-plus/src/types.ts:66](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L66)
33
+ Defined in: [packages/mdast-plus/src/types.ts:66](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L66)
34
34
 
35
35
  Hash of the source content
36
36
 
@@ -40,6 +40,6 @@ Hash of the source content
40
40
 
41
41
  > `optional` **raw**: `unknown`
42
42
 
43
- Defined in: [packages/mdast-plus/src/types.ts:64](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L64)
43
+ Defined in: [packages/mdast-plus/src/types.ts:64](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L64)
44
44
 
45
45
  Raw data from the source
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastFormatDefinition
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L27)
9
+ Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L27)
10
10
 
11
11
  Definition for an mdast format (parser/stringifier).
12
12
 
@@ -16,7 +16,7 @@ Definition for an mdast format (parser/stringifier).
16
16
 
17
17
  > `optional` **parse**: (`processor`) => `void`
18
18
 
19
- Defined in: [packages/mdast-plus/src/types.ts:29](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L29)
19
+ Defined in: [packages/mdast-plus/src/types.ts:29](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L29)
20
20
 
21
21
  Function to register parser plugins
22
22
 
@@ -36,7 +36,7 @@ Function to register parser plugins
36
36
 
37
37
  > `optional` **stringify**: (`processor`) => `void`
38
38
 
39
- Defined in: [packages/mdast-plus/src/types.ts:31](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L31)
39
+ Defined in: [packages/mdast-plus/src/types.ts:31](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L31)
40
40
 
41
41
  Function to register stringifier plugins
42
42
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastMark
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:73](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L73)
9
+ Defined in: [packages/mdast-plus/src/types.ts:73](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L73)
10
10
 
11
11
  mdast node for highlighted text (mark).
12
12
 
@@ -20,7 +20,7 @@ mdast node for highlighted text (mark).
20
20
 
21
21
  > **children**: `PhrasingContent`[]
22
22
 
23
- Defined in: [packages/mdast-plus/src/types.ts:75](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L75)
23
+ Defined in: [packages/mdast-plus/src/types.ts:75](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L75)
24
24
 
25
25
  List of children.
26
26
 
@@ -65,7 +65,7 @@ have a position.
65
65
 
66
66
  > **type**: `"mark"`
67
67
 
68
- Defined in: [packages/mdast-plus/src/types.ts:74](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L74)
68
+ Defined in: [packages/mdast-plus/src/types.ts:74](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L74)
69
69
 
70
70
  Node type.
71
71
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastPlugin
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:13](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L13)
9
+ Defined in: [packages/mdast-plus/src/types.ts:13](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L13)
10
10
 
11
11
  Definition for an mdast plugin.
12
12
 
@@ -16,7 +16,7 @@ Definition for an mdast plugin.
16
16
 
17
17
  > **name**: `string`
18
18
 
19
- Defined in: [packages/mdast-plus/src/types.ts:15](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L15)
19
+ Defined in: [packages/mdast-plus/src/types.ts:15](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L15)
20
20
 
21
21
  Plugin name
22
22
 
@@ -26,7 +26,7 @@ Plugin name
26
26
 
27
27
  > `optional` **order**: `number`
28
28
 
29
- Defined in: [packages/mdast-plus/src/types.ts:19](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L19)
29
+ Defined in: [packages/mdast-plus/src/types.ts:19](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L19)
30
30
 
31
31
  Execution order within the stage (lower numbers run first)
32
32
 
@@ -36,7 +36,7 @@ Execution order within the stage (lower numbers run first)
36
36
 
37
37
  > `optional` **stage**: [`Stage`](../type-aliases/Stage.md)
38
38
 
39
- Defined in: [packages/mdast-plus/src/types.ts:17](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L17)
39
+ Defined in: [packages/mdast-plus/src/types.ts:17](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L17)
40
40
 
41
41
  Processing stage the plugin belongs to
42
42
 
@@ -46,7 +46,7 @@ Processing stage the plugin belongs to
46
46
 
47
47
  > **transform**: (`tree`, `ctx`) => `void` \| `Promise`\<`void`\>
48
48
 
49
- Defined in: [packages/mdast-plus/src/types.ts:21](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L21)
49
+ Defined in: [packages/mdast-plus/src/types.ts:21](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L21)
50
50
 
51
51
  Transformation function
52
52
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastReader\<I\>
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:131](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L131)
9
+ Defined in: [packages/mdast-plus/src/types.ts:131](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L131)
10
10
 
11
11
  Interface for reading input into an mdast tree.
12
12
 
@@ -24,7 +24,7 @@ Input type
24
24
 
25
25
  > **read**(`input`): `Promise`\<`Root`\>
26
26
 
27
- Defined in: [packages/mdast-plus/src/types.ts:136](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L136)
27
+ Defined in: [packages/mdast-plus/src/types.ts:136](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L136)
28
28
 
29
29
  Reads input and returns an mdast Root node.
30
30
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastSub
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:81](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L81)
9
+ Defined in: [packages/mdast-plus/src/types.ts:81](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L81)
10
10
 
11
11
  mdast node for subscript text.
12
12
 
@@ -20,7 +20,7 @@ mdast node for subscript text.
20
20
 
21
21
  > **children**: `PhrasingContent`[]
22
22
 
23
- Defined in: [packages/mdast-plus/src/types.ts:83](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L83)
23
+ Defined in: [packages/mdast-plus/src/types.ts:83](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L83)
24
24
 
25
25
  List of children.
26
26
 
@@ -65,7 +65,7 @@ have a position.
65
65
 
66
66
  > **type**: `"sub"`
67
67
 
68
- Defined in: [packages/mdast-plus/src/types.ts:82](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L82)
68
+ Defined in: [packages/mdast-plus/src/types.ts:82](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L82)
69
69
 
70
70
  Node type.
71
71
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastSup
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:89](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L89)
9
+ Defined in: [packages/mdast-plus/src/types.ts:89](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L89)
10
10
 
11
11
  mdast node for superscript text.
12
12
 
@@ -20,7 +20,7 @@ mdast node for superscript text.
20
20
 
21
21
  > **children**: `PhrasingContent`[]
22
22
 
23
- Defined in: [packages/mdast-plus/src/types.ts:91](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L91)
23
+ Defined in: [packages/mdast-plus/src/types.ts:91](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L91)
24
24
 
25
25
  List of children.
26
26
 
@@ -65,7 +65,7 @@ have a position.
65
65
 
66
66
  > **type**: `"sup"`
67
67
 
68
- Defined in: [packages/mdast-plus/src/types.ts:90](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L90)
68
+ Defined in: [packages/mdast-plus/src/types.ts:90](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L90)
69
69
 
70
70
  Node type.
71
71
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastTransformer
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:142](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L142)
9
+ Defined in: [packages/mdast-plus/src/types.ts:142](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L142)
10
10
 
11
11
  Interface for transforming an mdast tree.
12
12
 
@@ -16,7 +16,7 @@ Interface for transforming an mdast tree.
16
16
 
17
17
  > **transform**(`tree`): `Promise`\<\{ `assets?`: [`MdastAsset`](MdastAsset.md)[]; `tree`: `Root`; \}\>
18
18
 
19
- Defined in: [packages/mdast-plus/src/types.ts:147](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L147)
19
+ Defined in: [packages/mdast-plus/src/types.ts:147](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L147)
20
20
 
21
21
  Transforms the given mdast tree.
22
22
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: MdastWriter\<Output\>
8
8
 
9
- Defined in: [packages/mdast-plus/src/types.ts:154](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L154)
9
+ Defined in: [packages/mdast-plus/src/types.ts:154](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L154)
10
10
 
11
11
  Interface for writing an mdast tree to an output format.
12
12
 
@@ -24,7 +24,7 @@ Output type (default: string)
24
24
 
25
25
  > **write**(`tree`, `assets?`): `Promise`\<[`ConvertResult`](ConvertResult.md)\<`Output`\>\>
26
26
 
27
- Defined in: [packages/mdast-plus/src/types.ts:160](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L160)
27
+ Defined in: [packages/mdast-plus/src/types.ts:160](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L160)
28
28
 
29
29
  Writes the mdast tree to the target output.
30
30
 
@@ -8,6 +8,6 @@
8
8
 
9
9
  > **Stage** = `"normalize"` \| `"compile"` \| `"finalize"`
10
10
 
11
- Defined in: [packages/mdast-plus/src/types.ts:8](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/types.ts#L8)
11
+ Defined in: [packages/mdast-plus/src/types.ts:8](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L8)
12
12
 
13
13
  Stages for mdast-plus pipeline processing.
@@ -0,0 +1,14 @@
1
+ [**@isdk/mdast-plus**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/mdast-plus](../globals.md) / htmlFormat
6
+
7
+ # Variable: htmlFormat
8
+
9
+ > `const` **htmlFormat**: [`MdastFormatDefinition`](../interfaces/MdastFormatDefinition.md)
10
+
11
+ Defined in: [packages/mdast-plus/src/formats/html.ts:33](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/formats/html.ts#L33)
12
+
13
+ HTML format definition for FluentProcessor.
14
+ Handles both parsing (HTML -> MDAST) and stringifying (MDAST -> HTML).
@@ -0,0 +1,14 @@
1
+ [**@isdk/mdast-plus**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/mdast-plus](../globals.md) / markdownFormat
6
+
7
+ # Variable: markdownFormat
8
+
9
+ > `const` **markdownFormat**: [`MdastFormatDefinition`](../interfaces/MdastFormatDefinition.md)
10
+
11
+ Defined in: [packages/mdast-plus/src/formats/markdown.ts:39](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/formats/markdown.ts#L39)
12
+
13
+ Markdown format definition for FluentProcessor.
14
+ Handles both parsing (Markdown -> MDAST) and stringifying (MDAST -> Markdown).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@isdk/mdast-plus",
3
3
  "description": "A semantic-first Markdown processing toolkit based on unified, remark, and rehype with a Fluent API and staged plugin system.",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "license": "MIT",
6
6
  "author": "Riceball LEE <snowyu.lee@gmail.com>",
7
7
  "homepage": "https://github.com/isdk/mdast-plus.js",
@@ -1,24 +0,0 @@
1
- [**@isdk/mdast-plus**](../README.md)
2
-
3
- ***
4
-
5
- [@isdk/mdast-plus](../globals.md) / htmlFormat
6
-
7
- # Function: htmlFormat()
8
-
9
- > **htmlFormat**(`this`): `void`
10
-
11
- Defined in: [packages/mdast-plus/src/formats/html.ts:9](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/formats/html.ts#L9)
12
-
13
- Unified plugin/configuration for HTML format.
14
- Includes mdast-to-hast conversion, sanitization (with table span support), and stringification.
15
-
16
- ## Parameters
17
-
18
- ### this
19
-
20
- `any`
21
-
22
- ## Returns
23
-
24
- `void`
@@ -1,24 +0,0 @@
1
- [**@isdk/mdast-plus**](../README.md)
2
-
3
- ***
4
-
5
- [@isdk/mdast-plus](../globals.md) / markdownFormat
6
-
7
- # Function: markdownFormat()
8
-
9
- > **markdownFormat**(`this`): `void`
10
-
11
- Defined in: [packages/mdast-plus/src/formats/markdown.ts:10](https://github.com/isdk/mdast-plus.js/blob/c94d215035e579925cf60814f0a5c05c543ca784/src/formats/markdown.ts#L10)
12
-
13
- Unified plugin/configuration for Markdown format.
14
- Includes GFM, directives, math, and frontmatter.
15
-
16
- ## Parameters
17
-
18
- ### this
19
-
20
- `any`
21
-
22
- ## Returns
23
-
24
- `void`