@openclaw/feishu 2026.10.5-beta.1 → 2026.10.5-beta.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/node_modules/mdast-util-to-markdown/index.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/configure.js +19 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.js +16 -5
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/code.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +11 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/html.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image.js +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +14 -4
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link.js +24 -9
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/root.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/text.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +6 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +6 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/index.js +34 -8
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/join.js +18 -1
- package/node_modules/mdast-util-to-markdown/lib/types.d.ts +50 -30
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/unsafe.js +15 -1
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts +23 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.js +32 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +3 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +9 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +95 -4
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +636 -57
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +12 -7
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +7 -2
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +20 -15
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.js +63 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/safe.js +71 -7
- package/node_modules/mdast-util-to-markdown/package.json +13 -57
- package/node_modules/mdast-util-to-markdown/readme.md +139 -84
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/compile.js +14 -4
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
- package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/preprocess.js +19 -21
- package/node_modules/micromark/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/lib/compile.js +37 -29
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/lib/create-tokenizer.js +37 -35
- package/node_modules/micromark/lib/initialize/document.js +21 -13
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/lib/initialize/text.js +7 -3
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/lib/preprocess.js +16 -19
- package/node_modules/micromark/package.json +2 -15
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
- package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
- package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
- package/node_modules/micromark-core-commonmark/package.json +4 -16
- package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/dev/index.js +58 -3
- package/node_modules/micromark-factory-space/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/index.js +55 -3
- package/node_modules/micromark-factory-space/package.json +1 -10
- package/node_modules/micromark-factory-space/readme.md +25 -25
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-types/index.d.ts +6 -3
- package/node_modules/micromark-util-types/package.json +2 -36
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +4 -4
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts +0 -7
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map +0 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Configure a base state w/ an extension.
|
|
3
|
+
*
|
|
2
4
|
* @param {State} base
|
|
5
|
+
* Base state to configure.
|
|
3
6
|
* @param {Options} extension
|
|
7
|
+
* Extension to apply.
|
|
4
8
|
* @returns {State}
|
|
9
|
+
* Given `base`.
|
|
5
10
|
*/
|
|
6
11
|
export function configure(base: State, extension: Options): State;
|
|
7
12
|
import type { State } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["configure.js"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["configure.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,gCAPW,KAAK,aAEL,OAAO,GAEL,KAAK,CAgDjB;2BA5DgC,YAAY;6BAAZ,YAAY"}
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
const own = {}.hasOwnProperty
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Configure a base state w/ an extension.
|
|
9
|
+
*
|
|
8
10
|
* @param {State} base
|
|
11
|
+
* Base state to configure.
|
|
9
12
|
* @param {Options} extension
|
|
13
|
+
* Extension to apply.
|
|
10
14
|
* @returns {State}
|
|
15
|
+
* Given `base`.
|
|
11
16
|
*/
|
|
12
17
|
export function configure(base, extension) {
|
|
13
18
|
let index = -1
|
|
@@ -57,9 +62,16 @@ export function configure(base, extension) {
|
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
/**
|
|
65
|
+
* Merge arrays from the extension into the base state.
|
|
66
|
+
*
|
|
60
67
|
* @template T
|
|
68
|
+
* Kind.
|
|
61
69
|
* @param {Array<T>} left
|
|
70
|
+
* List to merge into.
|
|
62
71
|
* @param {Array<T> | null | undefined} right
|
|
72
|
+
* List to merge from.
|
|
73
|
+
* @returns {undefined}
|
|
74
|
+
* Nothing.
|
|
63
75
|
*/
|
|
64
76
|
function list(left, right) {
|
|
65
77
|
if (right) {
|
|
@@ -68,9 +80,16 @@ function list(left, right) {
|
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
/**
|
|
83
|
+
* Merge objects from the extension into the base state.
|
|
84
|
+
*
|
|
71
85
|
* @template T
|
|
86
|
+
* Kind.
|
|
72
87
|
* @param {Record<string, T>} left
|
|
88
|
+
* Object to merge into.
|
|
73
89
|
* @param {Record<string, T> | null | undefined} right
|
|
90
|
+
* Object to merge from.
|
|
91
|
+
* @returns {undefined}
|
|
92
|
+
* Nothing.
|
|
74
93
|
*/
|
|
75
94
|
function map(left, right) {
|
|
76
95
|
if (right) {
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* @import {Info, Map, State} from 'mdast-util-to-markdown'
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
+
* Serialize a blockquote node.
|
|
7
|
+
*
|
|
6
8
|
* @param {Blockquote} node
|
|
9
|
+
* Node to serialize.
|
|
7
10
|
* @param {Parents | undefined} _
|
|
11
|
+
* Parent node.
|
|
8
12
|
* @param {State} state
|
|
13
|
+
* Info passed around.
|
|
9
14
|
* @param {Info} info
|
|
15
|
+
* Info on surrounding context.
|
|
10
16
|
* @returns {string}
|
|
17
|
+
* Serialized markdown.
|
|
11
18
|
*/
|
|
12
19
|
export function blockquote(node: Blockquote, _: Parents | undefined, state: State, info: Info): string;
|
|
13
20
|
import type { Blockquote } from 'mdast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AACH,iCAXW,UAAU,KAEV,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAclB;gCA7BqC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"}
|
|
@@ -4,11 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Serialize a blockquote node.
|
|
8
|
+
*
|
|
7
9
|
* @param {Blockquote} node
|
|
10
|
+
* Node to serialize.
|
|
8
11
|
* @param {Parents | undefined} _
|
|
12
|
+
* Parent node.
|
|
9
13
|
* @param {State} state
|
|
14
|
+
* Info passed around.
|
|
10
15
|
* @param {Info} info
|
|
16
|
+
* Info on surrounding context.
|
|
11
17
|
* @returns {string}
|
|
18
|
+
* Serialized markdown.
|
|
12
19
|
*/
|
|
13
20
|
export function blockquote(node, _, state, info) {
|
|
14
21
|
const exit = state.enter('blockquote')
|
|
@@ -23,7 +30,11 @@ export function blockquote(node, _, state, info) {
|
|
|
23
30
|
return value
|
|
24
31
|
}
|
|
25
32
|
|
|
26
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Indent lines w/ blockquote markers.
|
|
35
|
+
*
|
|
36
|
+
* @type {Map}
|
|
37
|
+
*/
|
|
27
38
|
function map(line, _, blank) {
|
|
28
39
|
return '>' + (blank ? '' : ' ') + line
|
|
29
40
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize a break node.
|
|
3
|
+
*
|
|
2
4
|
* @param {Break} _
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @param {Parents | undefined} _1
|
|
7
|
+
* Parent node.
|
|
4
8
|
* @param {State} state
|
|
9
|
+
* Info passed around.
|
|
5
10
|
* @param {Info} info
|
|
11
|
+
* Info on surrounding context.
|
|
6
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
7
14
|
*/
|
|
8
15
|
export function hardBreak(_: Break, _1: Parents | undefined, state: State, info: Info): string;
|
|
9
16
|
import type { Break } from 'mdast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,6BAXW,KAAK,MAEL,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAsBlB;2BAvCgC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"}
|
|
@@ -6,23 +6,34 @@
|
|
|
6
6
|
import {patternInScope} from '../util/pattern-in-scope.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Serialize a break node.
|
|
10
|
+
*
|
|
9
11
|
* @param {Break} _
|
|
12
|
+
* Node to serialize.
|
|
10
13
|
* @param {Parents | undefined} _1
|
|
14
|
+
* Parent node.
|
|
11
15
|
* @param {State} state
|
|
16
|
+
* Info passed around.
|
|
12
17
|
* @param {Info} info
|
|
18
|
+
* Info on surrounding context.
|
|
13
19
|
* @returns {string}
|
|
20
|
+
* Serialized markdown.
|
|
14
21
|
*/
|
|
15
22
|
export function hardBreak(_, _1, state, info) {
|
|
16
23
|
let index = -1
|
|
17
24
|
|
|
18
25
|
while (++index < state.unsafe.length) {
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
const pattern = state.unsafe[index]
|
|
27
|
+
|
|
28
|
+
// If we can’t put unconditional eols in this construct (setext headings,
|
|
29
|
+
// tables), use a space instead.
|
|
21
30
|
if (
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
pattern.character === '\n' &&
|
|
32
|
+
!pattern.before &&
|
|
33
|
+
!pattern.after &&
|
|
34
|
+
patternInScope(state.stack, pattern)
|
|
24
35
|
) {
|
|
25
|
-
return /[
|
|
36
|
+
return /[\t ]/.test(info.before) ? '' : ' '
|
|
26
37
|
}
|
|
27
38
|
}
|
|
28
39
|
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize a code node.
|
|
3
|
+
*
|
|
2
4
|
* @param {Code} node
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @param {Parents | undefined} _
|
|
7
|
+
* Parent node.
|
|
4
8
|
* @param {State} state
|
|
9
|
+
* Info passed around.
|
|
5
10
|
* @param {Info} info
|
|
11
|
+
* Info on surrounding context.
|
|
6
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
7
14
|
*/
|
|
8
15
|
export function code(node: Code, _: Parents | undefined, state: State, info: Info): string;
|
|
9
16
|
import type { Code } from 'mdast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["code.js"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["code.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;GAaG;AACH,2BAXW,IAAI,KAEJ,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAwDlB;0BA1E+B,OAAO;6BAAP,OAAO;2BADJ,wBAAwB;0BAAxB,wBAAwB"}
|
|
@@ -8,16 +8,22 @@ import {formatCodeAsIndented} from '../util/format-code-as-indented.js'
|
|
|
8
8
|
import {checkFence} from '../util/check-fence.js'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Serialize a code node.
|
|
12
|
+
*
|
|
11
13
|
* @param {Code} node
|
|
14
|
+
* Node to serialize.
|
|
12
15
|
* @param {Parents | undefined} _
|
|
16
|
+
* Parent node.
|
|
13
17
|
* @param {State} state
|
|
18
|
+
* Info passed around.
|
|
14
19
|
* @param {Info} info
|
|
20
|
+
* Info on surrounding context.
|
|
15
21
|
* @returns {string}
|
|
22
|
+
* Serialized markdown.
|
|
16
23
|
*/
|
|
17
24
|
export function code(node, _, state, info) {
|
|
18
25
|
const marker = checkFence(state)
|
|
19
26
|
const raw = node.value || ''
|
|
20
|
-
const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'
|
|
21
27
|
|
|
22
28
|
if (formatCodeAsIndented(node, state)) {
|
|
23
29
|
const exit = state.enter('codeIndented')
|
|
@@ -29,6 +35,7 @@ export function code(node, _, state, info) {
|
|
|
29
35
|
const tracker = state.createTracker(info)
|
|
30
36
|
const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))
|
|
31
37
|
const exit = state.enter('codeFenced')
|
|
38
|
+
const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'
|
|
32
39
|
let value = tracker.move(sequence)
|
|
33
40
|
|
|
34
41
|
if (node.lang) {
|
|
@@ -69,7 +76,11 @@ export function code(node, _, state, info) {
|
|
|
69
76
|
return value
|
|
70
77
|
}
|
|
71
78
|
|
|
72
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Indent lines w/ code indent.
|
|
81
|
+
*
|
|
82
|
+
* @type {Map}
|
|
83
|
+
*/
|
|
73
84
|
function map(line, _, blank) {
|
|
74
85
|
return (blank ? '' : ' ') + line
|
|
75
86
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize a definition node.
|
|
3
|
+
*
|
|
2
4
|
* @param {Definition} node
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @param {Parents | undefined} _
|
|
7
|
+
* Parent node.
|
|
4
8
|
* @param {State} state
|
|
9
|
+
* Info passed around.
|
|
5
10
|
* @param {Info} info
|
|
11
|
+
* Info on surrounding context.
|
|
6
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
7
14
|
*/
|
|
8
15
|
export function definition(node: Definition, _: Parents | undefined, state: State, info: Info): string;
|
|
9
16
|
import type { Definition } from 'mdast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["definition.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["definition.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,iCAXW,UAAU,KAEV,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAgElB;gCAhFqC,OAAO;6BAAP,OAAO;2BADf,wBAAwB;0BAAxB,wBAAwB"}
|
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
import {checkQuote} from '../util/check-quote.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Serialize a definition node.
|
|
10
|
+
*
|
|
9
11
|
* @param {Definition} node
|
|
12
|
+
* Node to serialize.
|
|
10
13
|
* @param {Parents | undefined} _
|
|
14
|
+
* Parent node.
|
|
11
15
|
* @param {State} state
|
|
16
|
+
* Info passed around.
|
|
12
17
|
* @param {Info} info
|
|
18
|
+
* Info on surrounding context.
|
|
13
19
|
* @returns {string}
|
|
20
|
+
* Serialized markdown.
|
|
14
21
|
*/
|
|
15
22
|
export function definition(node, _, state, info) {
|
|
16
23
|
const quote = checkQuote(state)
|
|
@@ -1,24 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize an emphasis node.
|
|
3
|
+
*
|
|
4
|
+
* Attention is properly handled by `containerPhrasing`.
|
|
5
|
+
*
|
|
2
6
|
* @param {Emphasis} node
|
|
7
|
+
* Node to serialize.
|
|
3
8
|
* @param {Parents | undefined} _
|
|
9
|
+
* Parent node.
|
|
4
10
|
* @param {State} state
|
|
11
|
+
* Info passed around.
|
|
5
12
|
* @param {Info} info
|
|
13
|
+
* Info on surrounding context.
|
|
6
14
|
* @returns {string}
|
|
15
|
+
* Serialized markdown.
|
|
7
16
|
*/
|
|
8
17
|
export function emphasis(node: Emphasis, _: Parents | undefined, state: State, info: Info): string;
|
|
9
18
|
export namespace emphasis {
|
|
10
|
-
export {
|
|
19
|
+
export { attention };
|
|
20
|
+
export { peek };
|
|
11
21
|
}
|
|
12
22
|
import type { Emphasis } from 'mdast';
|
|
13
23
|
import type { Parents } from 'mdast';
|
|
14
24
|
import type { State } from 'mdast-util-to-markdown';
|
|
15
25
|
import type { Info } from 'mdast-util-to-markdown';
|
|
16
26
|
/**
|
|
27
|
+
* Serialize an emphasis node as attention.
|
|
28
|
+
*
|
|
17
29
|
* @param {Emphasis} _
|
|
30
|
+
* Node to serialize.
|
|
31
|
+
* @param {State} state
|
|
32
|
+
* Info passed around.
|
|
33
|
+
* @returns {AttentionInfo}
|
|
34
|
+
* Info on how to serialize the node.
|
|
35
|
+
*/
|
|
36
|
+
declare function attention(_: Emphasis, state: State): AttentionInfo;
|
|
37
|
+
/**
|
|
38
|
+
* Peek at this node.
|
|
39
|
+
*
|
|
40
|
+
* @param {Emphasis} _
|
|
41
|
+
* Node to serialize.
|
|
18
42
|
* @param {Parents | undefined} _1
|
|
43
|
+
* Parent node.
|
|
19
44
|
* @param {State} state
|
|
45
|
+
* Info passed around.
|
|
20
46
|
* @returns {string}
|
|
47
|
+
* Start of the serialized markdown.
|
|
21
48
|
*/
|
|
22
|
-
declare function
|
|
49
|
+
declare function peek(_: Emphasis, _1: Parents | undefined, state: State): string;
|
|
50
|
+
import type { AttentionInfo } from 'mdast-util-to-markdown';
|
|
23
51
|
export {};
|
|
24
52
|
//# sourceMappingURL=emphasis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;GAeG;AACH,+BAXW,QAAQ,KAER,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAQlB;;;;;8BA7BmC,OAAO;6BAAP,OAAO;2BADE,wBAAwB;0BAAxB,wBAAwB;AAgCrE;;;;;;;;;GASG;AACH,8BAPW,QAAQ,SAER,KAAK,GAEH,aAAa,CAUzB;AAED;;;;;;;;;;;GAWG;AACH,yBATW,QAAQ,MAER,OAAO,GAAG,SAAS,SAEnB,KAAK,GAEH,MAAM,CAKlB;mCAjE4C,wBAAwB"}
|
|
@@ -1,69 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
2
|
+
* @import {AttentionInfo, Info, State} from 'mdast-util-to-markdown'
|
|
3
3
|
* @import {Emphasis, Parents} from 'mdast'
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {checkEmphasis} from '../util/check-emphasis.js'
|
|
7
|
-
import {encodeCharacterReference} from '../util/encode-character-reference.js'
|
|
8
|
-
import {encodeInfo} from '../util/encode-info.js'
|
|
9
7
|
|
|
10
|
-
emphasis.
|
|
8
|
+
emphasis.attention = attention
|
|
9
|
+
emphasis.peek = peek
|
|
11
10
|
|
|
12
11
|
/**
|
|
12
|
+
* Serialize an emphasis node.
|
|
13
|
+
*
|
|
14
|
+
* Attention is properly handled by `containerPhrasing`.
|
|
15
|
+
*
|
|
13
16
|
* @param {Emphasis} node
|
|
17
|
+
* Node to serialize.
|
|
14
18
|
* @param {Parents | undefined} _
|
|
19
|
+
* Parent node.
|
|
15
20
|
* @param {State} state
|
|
21
|
+
* Info passed around.
|
|
16
22
|
* @param {Info} info
|
|
23
|
+
* Info on surrounding context.
|
|
17
24
|
* @returns {string}
|
|
25
|
+
* Serialized markdown.
|
|
18
26
|
*/
|
|
19
27
|
export function emphasis(node, _, state, info) {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const tracker = state.createTracker(info)
|
|
23
|
-
const before = tracker.move(marker)
|
|
24
|
-
|
|
25
|
-
let between = tracker.move(
|
|
26
|
-
state.containerPhrasing(node, {
|
|
27
|
-
after: marker,
|
|
28
|
-
before,
|
|
29
|
-
...tracker.current()
|
|
30
|
-
})
|
|
31
|
-
)
|
|
32
|
-
const betweenHead = between.charCodeAt(0)
|
|
33
|
-
const open = encodeInfo(
|
|
34
|
-
info.before.charCodeAt(info.before.length - 1),
|
|
35
|
-
betweenHead,
|
|
36
|
-
marker
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
if (open.inside) {
|
|
40
|
-
between = encodeCharacterReference(betweenHead) + between.slice(1)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const betweenTail = between.charCodeAt(between.length - 1)
|
|
44
|
-
const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)
|
|
45
|
-
|
|
46
|
-
if (close.inside) {
|
|
47
|
-
between = between.slice(0, -1) + encodeCharacterReference(betweenTail)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const after = tracker.move(marker)
|
|
51
|
-
|
|
28
|
+
const exit = state.enter('phrasing')
|
|
29
|
+
const value = state.containerPhrasing({type: 'root', children: [node]}, info)
|
|
52
30
|
exit()
|
|
31
|
+
return value
|
|
32
|
+
}
|
|
53
33
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Serialize an emphasis node as attention.
|
|
36
|
+
*
|
|
37
|
+
* @param {Emphasis} _
|
|
38
|
+
* Node to serialize.
|
|
39
|
+
* @param {State} state
|
|
40
|
+
* Info passed around.
|
|
41
|
+
* @returns {AttentionInfo}
|
|
42
|
+
* Info on how to serialize the node.
|
|
43
|
+
*/
|
|
44
|
+
function attention(_, state) {
|
|
45
|
+
const marker = checkEmphasis(state)
|
|
46
|
+
return {
|
|
47
|
+
construct: 'emphasis',
|
|
48
|
+
markers: marker === '*' ? ['*', '_'] : ['_', '*'],
|
|
49
|
+
sizes: [1]
|
|
57
50
|
}
|
|
58
|
-
return before + between + after
|
|
59
51
|
}
|
|
60
52
|
|
|
61
53
|
/**
|
|
54
|
+
* Peek at this node.
|
|
55
|
+
*
|
|
62
56
|
* @param {Emphasis} _
|
|
57
|
+
* Node to serialize.
|
|
63
58
|
* @param {Parents | undefined} _1
|
|
59
|
+
* Parent node.
|
|
64
60
|
* @param {State} state
|
|
61
|
+
* Info passed around.
|
|
65
62
|
* @returns {string}
|
|
63
|
+
* Start of the serialized markdown.
|
|
66
64
|
*/
|
|
67
|
-
function
|
|
65
|
+
function peek(_, _1, state) {
|
|
68
66
|
return state.options.emphasis || '*'
|
|
69
67
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize a heading node.
|
|
3
|
+
*
|
|
2
4
|
* @param {Heading} node
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @param {Parents | undefined} _
|
|
7
|
+
* Parent node.
|
|
4
8
|
* @param {State} state
|
|
9
|
+
* Info passed around.
|
|
5
10
|
* @param {Info} info
|
|
11
|
+
* Info on surrounding context.
|
|
6
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
7
14
|
*/
|
|
8
15
|
export function heading(node: Heading, _: Parents | undefined, state: State, info: Info): string;
|
|
9
16
|
import type { Heading } from 'mdast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,8BAXW,OAAO,KAEP,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAgElB;6BAjFkC,OAAO;6BAAP,OAAO;2BADZ,wBAAwB;0BAAxB,wBAAwB"}
|
|
@@ -7,11 +7,18 @@ import {encodeCharacterReference} from '../util/encode-character-reference.js'
|
|
|
7
7
|
import {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* Serialize a heading node.
|
|
11
|
+
*
|
|
10
12
|
* @param {Heading} node
|
|
13
|
+
* Node to serialize.
|
|
11
14
|
* @param {Parents | undefined} _
|
|
15
|
+
* Parent node.
|
|
12
16
|
* @param {State} state
|
|
17
|
+
* Info passed around.
|
|
13
18
|
* @param {Info} info
|
|
19
|
+
* Info on surrounding context.
|
|
14
20
|
* @returns {string}
|
|
21
|
+
* Serialized markdown.
|
|
15
22
|
*/
|
|
16
23
|
export function heading(node, _, state, info) {
|
|
17
24
|
const rank = Math.max(Math.min(6, node.depth || 1), 1)
|
|
@@ -57,9 +64,11 @@ export function heading(node, _, state, info) {
|
|
|
57
64
|
...tracker.current()
|
|
58
65
|
})
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
const head = value.charCodeAt(0)
|
|
68
|
+
|
|
69
|
+
if (head === 9 /* `\t` */ || head === 32 /* ` ` */) {
|
|
61
70
|
// To do: what effect has the character reference on tracking?
|
|
62
|
-
value = encodeCharacterReference(
|
|
71
|
+
value = encodeCharacterReference(head) + value.slice(1)
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
value = value ? sequence + ' ' + value : sequence
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize an HTML node.
|
|
3
|
+
*
|
|
2
4
|
* @param {Html} node
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @returns {string}
|
|
7
|
+
* Serialized markdown.
|
|
4
8
|
*/
|
|
5
9
|
export function html(node: Html): string;
|
|
6
10
|
export namespace html {
|
|
@@ -8,7 +12,10 @@ export namespace html {
|
|
|
8
12
|
}
|
|
9
13
|
import type { Html } from 'mdast';
|
|
10
14
|
/**
|
|
15
|
+
* Peek at this node.
|
|
16
|
+
*
|
|
11
17
|
* @returns {string}
|
|
18
|
+
* Start of the serialized markdown.
|
|
12
19
|
*/
|
|
13
20
|
declare function htmlPeek(): string;
|
|
14
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,2BALW,IAAI,GAEF,MAAM,CAKlB;;;;0BAfsB,OAAO;AAiB9B;;;;;GAKG;AACH,6BAHa,MAAM,CAKlB"}
|
|
@@ -5,15 +5,22 @@
|
|
|
5
5
|
html.peek = htmlPeek
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Serialize an HTML node.
|
|
9
|
+
*
|
|
8
10
|
* @param {Html} node
|
|
11
|
+
* Node to serialize.
|
|
9
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
10
14
|
*/
|
|
11
15
|
export function html(node) {
|
|
12
16
|
return node.value || ''
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
/**
|
|
20
|
+
* Peek at this node.
|
|
21
|
+
*
|
|
16
22
|
* @returns {string}
|
|
23
|
+
* Start of the serialized markdown.
|
|
17
24
|
*/
|
|
18
25
|
function htmlPeek() {
|
|
19
26
|
return '<'
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Serialize an image reference node.
|
|
3
|
+
*
|
|
2
4
|
* @param {ImageReference} node
|
|
5
|
+
* Node to serialize.
|
|
3
6
|
* @param {Parents | undefined} _
|
|
7
|
+
* Parent node.
|
|
4
8
|
* @param {State} state
|
|
9
|
+
* Info passed around.
|
|
5
10
|
* @param {Info} info
|
|
11
|
+
* Info on surrounding context.
|
|
6
12
|
* @returns {string}
|
|
13
|
+
* Serialized markdown.
|
|
7
14
|
*/
|
|
8
15
|
export function imageReference(node: ImageReference, _: Parents | undefined, state: State, info: Info): string;
|
|
9
16
|
export namespace imageReference {
|
|
@@ -14,7 +21,10 @@ import type { Parents } from 'mdast';
|
|
|
14
21
|
import type { State } from 'mdast-util-to-markdown';
|
|
15
22
|
import type { Info } from 'mdast-util-to-markdown';
|
|
16
23
|
/**
|
|
24
|
+
* Peek at this node.
|
|
25
|
+
*
|
|
17
26
|
* @returns {string}
|
|
27
|
+
* Start of the serialized markdown.
|
|
18
28
|
*/
|
|
19
29
|
declare function imageReferencePeek(): string;
|
|
20
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,qCAXW,cAAc,KAEd,OAAO,GAAG,SAAS,SAEnB,KAAK,QAEL,IAAI,GAEF,MAAM,CAiDlB;;;;oCAjEyC,OAAO;6BAAP,OAAO;2BADnB,wBAAwB;0BAAxB,wBAAwB;AAoEtD;;;;;GAKG;AACH,uCAHa,MAAM,CAKlB"}
|
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
imageReference.peek = imageReferencePeek
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Serialize an image reference node.
|
|
10
|
+
*
|
|
9
11
|
* @param {ImageReference} node
|
|
12
|
+
* Node to serialize.
|
|
10
13
|
* @param {Parents | undefined} _
|
|
14
|
+
* Parent node.
|
|
11
15
|
* @param {State} state
|
|
16
|
+
* Info passed around.
|
|
12
17
|
* @param {Info} info
|
|
18
|
+
* Info on surrounding context.
|
|
13
19
|
* @returns {string}
|
|
20
|
+
* Serialized markdown.
|
|
14
21
|
*/
|
|
15
22
|
export function imageReference(node, _, state, info) {
|
|
16
23
|
const type = node.referenceType
|
|
@@ -26,9 +33,14 @@ export function imageReference(node, _, state, info) {
|
|
|
26
33
|
value += tracker.move(alt + '][')
|
|
27
34
|
|
|
28
35
|
subexit()
|
|
29
|
-
// Hide
|
|
36
|
+
// Hide that we’re in phrasing as things like attention or code cannot form
|
|
37
|
+
// in references.
|
|
38
|
+
// Character escapes and references *do* work.
|
|
39
|
+
// It is important to know about other constructs, such as table cells.
|
|
30
40
|
const stack = state.stack
|
|
31
|
-
state.stack =
|
|
41
|
+
state.stack = stack.filter(function (d) {
|
|
42
|
+
return d !== 'phrasing'
|
|
43
|
+
})
|
|
32
44
|
subexit = state.enter('reference')
|
|
33
45
|
// Note: for proper tracking, we should reset the output positions when we end
|
|
34
46
|
// up making a `shortcut` reference, because then there is no brace output.
|
|
@@ -56,7 +68,10 @@ export function imageReference(node, _, state, info) {
|
|
|
56
68
|
}
|
|
57
69
|
|
|
58
70
|
/**
|
|
71
|
+
* Peek at this node.
|
|
72
|
+
*
|
|
59
73
|
* @returns {string}
|
|
74
|
+
* Start of the serialized markdown.
|
|
60
75
|
*/
|
|
61
76
|
function imageReferencePeek() {
|
|
62
77
|
return '!'
|