@gmb/bitmark-parser-generator 5.40.0 → 5.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/browser/cjs/index.cjs +876 -272
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +9 -17
- package/dist/browser/esm/index.d.ts +9 -17
- package/dist/browser/esm/index.js +876 -272
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +878 -275
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +879 -275
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -17
- package/dist/index.d.ts +9 -17
- package/dist/index.js +879 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -4077,6 +4077,8 @@ type GenerateOptions = {
|
|
|
4077
4077
|
noBreakscaping?: boolean;
|
|
4078
4078
|
forceInline?: boolean;
|
|
4079
4079
|
noMarkup?: boolean;
|
|
4080
|
+
/** The AST is a chain value (footnote content): only plain text and short-form marks */
|
|
4081
|
+
chainValueContext?: boolean;
|
|
4080
4082
|
};
|
|
4081
4083
|
declare const Stage: {
|
|
4082
4084
|
enter: string;
|
|
@@ -4086,9 +4088,6 @@ declare const Stage: {
|
|
|
4086
4088
|
type StageType = EnumType<typeof Stage>;
|
|
4087
4089
|
type WriteCallback = (s: string) => void;
|
|
4088
4090
|
type BodyBitCallback = (bodyBit: BodyBitJson, index: number, route: NodeInfo[]) => string;
|
|
4089
|
-
interface MediaAttributeOptions {
|
|
4090
|
-
ignoreAttributes?: Set<string>;
|
|
4091
|
-
}
|
|
4092
4091
|
/**
|
|
4093
4092
|
* Generate text from a bitmark text AST
|
|
4094
4093
|
*/
|
|
@@ -4114,6 +4113,8 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4114
4113
|
private textDepth;
|
|
4115
4114
|
private placeholderIndex;
|
|
4116
4115
|
private placeholders;
|
|
4116
|
+
private chainJustClosed;
|
|
4117
|
+
private simpleLinkAllowed;
|
|
4117
4118
|
private rootParagraphNodeContentIndex;
|
|
4118
4119
|
private previousRootParagraphContextType;
|
|
4119
4120
|
private inPreText;
|
|
@@ -4186,6 +4187,11 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4186
4187
|
* @returns true if a simple link, otherwise false
|
|
4187
4188
|
*/
|
|
4188
4189
|
protected isSimpleLink(node: TextNode): boolean;
|
|
4190
|
+
/**
|
|
4191
|
+
* The bare-URL link short form is only safe when whatever is written next cannot be read as
|
|
4192
|
+
* part of the URL (the parser's Url rule consumes every following UrlChar).
|
|
4193
|
+
*/
|
|
4194
|
+
protected isSimpleLinkAllowedAfter(route: NodeInfo[]): boolean;
|
|
4189
4195
|
/**
|
|
4190
4196
|
* Get the link text if the node is a link, otherwise return false
|
|
4191
4197
|
*
|
|
@@ -4224,24 +4230,12 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4224
4230
|
protected writeParagraph(node: TextNode, route: NodeInfo[]): void;
|
|
4225
4231
|
protected writeHardBreak(_node: TextNode): void;
|
|
4226
4232
|
protected writeHeading(node: HeadingTextNode): void;
|
|
4227
|
-
protected writeSection(node: SectionTextNode): void;
|
|
4228
4233
|
protected writeBullet(node: TextNode, route: NodeInfo[]): void;
|
|
4229
4234
|
protected writeImage(node: ImageTextNode | ImageInlineTextNode): void;
|
|
4230
4235
|
protected writeCodeBlock(node: CodeBlockTextNode): void;
|
|
4231
4236
|
protected writeLatex(node: LatexTextNode): void;
|
|
4232
4237
|
protected writeMarkTextWrapper(s: string): void;
|
|
4233
4238
|
protected writeInlineMark(mark: TextMark): void;
|
|
4234
|
-
/**
|
|
4235
|
-
* Resolve the marks of a text node into the marks that will actually be written.
|
|
4236
|
-
*
|
|
4237
|
-
* - Merges a legacy standalone 'duration' mark into its sibling 'timer' mark.
|
|
4238
|
-
* - Drops marks the current grammar cannot express (standalone 'duration', 'timer'
|
|
4239
|
-
* without a duration).
|
|
4240
|
-
* - Moves a 'textStyle'/'color' mark before a preceding bare 'highlight'/'userHighlight'
|
|
4241
|
-
* mark when its color is a valid highlight color; written in the original order the
|
|
4242
|
-
* output would re-parse as a highlight-with-color compound mark and change meaning.
|
|
4243
|
-
*/
|
|
4244
|
-
protected getWritableMarks(nodeMarks: TextMark[]): TextMark[];
|
|
4245
4239
|
/**
|
|
4246
4240
|
* True if the mark is written using its standard form (e.g. **bold**, !!highlight!!)
|
|
4247
4241
|
* when it is the only mark. A highlight mark with a color attribute is excluded - it
|
|
@@ -4269,7 +4263,6 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4269
4263
|
close?: boolean;
|
|
4270
4264
|
single?: boolean;
|
|
4271
4265
|
}): void;
|
|
4272
|
-
protected getMediaAttrs(mediaType: string, attrs: MediaAttributes, options?: MediaAttributeOptions): string | undefined;
|
|
4273
4266
|
protected breakscape(s: string, options: BreakscapeOptions$1): string;
|
|
4274
4267
|
protected getBitType(route: NodeInfo[]): BitTypeType | undefined;
|
|
4275
4268
|
/**
|
|
@@ -7699,7 +7692,6 @@ declare class HtmlTableGenerator {
|
|
|
7699
7692
|
private listItemToHtml;
|
|
7700
7693
|
private imageToHtml;
|
|
7701
7694
|
private textToHtml;
|
|
7702
|
-
private inlineImageTokenToHtml;
|
|
7703
7695
|
private latexToHtml;
|
|
7704
7696
|
private escapeText;
|
|
7705
7697
|
private escapeAttr;
|
package/dist/index.d.ts
CHANGED
|
@@ -4077,6 +4077,8 @@ type GenerateOptions = {
|
|
|
4077
4077
|
noBreakscaping?: boolean;
|
|
4078
4078
|
forceInline?: boolean;
|
|
4079
4079
|
noMarkup?: boolean;
|
|
4080
|
+
/** The AST is a chain value (footnote content): only plain text and short-form marks */
|
|
4081
|
+
chainValueContext?: boolean;
|
|
4080
4082
|
};
|
|
4081
4083
|
declare const Stage: {
|
|
4082
4084
|
enter: string;
|
|
@@ -4086,9 +4088,6 @@ declare const Stage: {
|
|
|
4086
4088
|
type StageType = EnumType<typeof Stage>;
|
|
4087
4089
|
type WriteCallback = (s: string) => void;
|
|
4088
4090
|
type BodyBitCallback = (bodyBit: BodyBitJson, index: number, route: NodeInfo[]) => string;
|
|
4089
|
-
interface MediaAttributeOptions {
|
|
4090
|
-
ignoreAttributes?: Set<string>;
|
|
4091
|
-
}
|
|
4092
4091
|
/**
|
|
4093
4092
|
* Generate text from a bitmark text AST
|
|
4094
4093
|
*/
|
|
@@ -4114,6 +4113,8 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4114
4113
|
private textDepth;
|
|
4115
4114
|
private placeholderIndex;
|
|
4116
4115
|
private placeholders;
|
|
4116
|
+
private chainJustClosed;
|
|
4117
|
+
private simpleLinkAllowed;
|
|
4117
4118
|
private rootParagraphNodeContentIndex;
|
|
4118
4119
|
private previousRootParagraphContextType;
|
|
4119
4120
|
private inPreText;
|
|
@@ -4186,6 +4187,11 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4186
4187
|
* @returns true if a simple link, otherwise false
|
|
4187
4188
|
*/
|
|
4188
4189
|
protected isSimpleLink(node: TextNode): boolean;
|
|
4190
|
+
/**
|
|
4191
|
+
* The bare-URL link short form is only safe when whatever is written next cannot be read as
|
|
4192
|
+
* part of the URL (the parser's Url rule consumes every following UrlChar).
|
|
4193
|
+
*/
|
|
4194
|
+
protected isSimpleLinkAllowedAfter(route: NodeInfo[]): boolean;
|
|
4189
4195
|
/**
|
|
4190
4196
|
* Get the link text if the node is a link, otherwise return false
|
|
4191
4197
|
*
|
|
@@ -4224,24 +4230,12 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4224
4230
|
protected writeParagraph(node: TextNode, route: NodeInfo[]): void;
|
|
4225
4231
|
protected writeHardBreak(_node: TextNode): void;
|
|
4226
4232
|
protected writeHeading(node: HeadingTextNode): void;
|
|
4227
|
-
protected writeSection(node: SectionTextNode): void;
|
|
4228
4233
|
protected writeBullet(node: TextNode, route: NodeInfo[]): void;
|
|
4229
4234
|
protected writeImage(node: ImageTextNode | ImageInlineTextNode): void;
|
|
4230
4235
|
protected writeCodeBlock(node: CodeBlockTextNode): void;
|
|
4231
4236
|
protected writeLatex(node: LatexTextNode): void;
|
|
4232
4237
|
protected writeMarkTextWrapper(s: string): void;
|
|
4233
4238
|
protected writeInlineMark(mark: TextMark): void;
|
|
4234
|
-
/**
|
|
4235
|
-
* Resolve the marks of a text node into the marks that will actually be written.
|
|
4236
|
-
*
|
|
4237
|
-
* - Merges a legacy standalone 'duration' mark into its sibling 'timer' mark.
|
|
4238
|
-
* - Drops marks the current grammar cannot express (standalone 'duration', 'timer'
|
|
4239
|
-
* without a duration).
|
|
4240
|
-
* - Moves a 'textStyle'/'color' mark before a preceding bare 'highlight'/'userHighlight'
|
|
4241
|
-
* mark when its color is a valid highlight color; written in the original order the
|
|
4242
|
-
* output would re-parse as a highlight-with-color compound mark and change meaning.
|
|
4243
|
-
*/
|
|
4244
|
-
protected getWritableMarks(nodeMarks: TextMark[]): TextMark[];
|
|
4245
4239
|
/**
|
|
4246
4240
|
* True if the mark is written using its standard form (e.g. **bold**, !!highlight!!)
|
|
4247
4241
|
* when it is the only mark. A highlight mark with a color attribute is excluded - it
|
|
@@ -4269,7 +4263,6 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
|
|
|
4269
4263
|
close?: boolean;
|
|
4270
4264
|
single?: boolean;
|
|
4271
4265
|
}): void;
|
|
4272
|
-
protected getMediaAttrs(mediaType: string, attrs: MediaAttributes, options?: MediaAttributeOptions): string | undefined;
|
|
4273
4266
|
protected breakscape(s: string, options: BreakscapeOptions$1): string;
|
|
4274
4267
|
protected getBitType(route: NodeInfo[]): BitTypeType | undefined;
|
|
4275
4268
|
/**
|
|
@@ -7699,7 +7692,6 @@ declare class HtmlTableGenerator {
|
|
|
7699
7692
|
private listItemToHtml;
|
|
7700
7693
|
private imageToHtml;
|
|
7701
7694
|
private textToHtml;
|
|
7702
|
-
private inlineImageTokenToHtml;
|
|
7703
7695
|
private latexToHtml;
|
|
7704
7696
|
private escapeText;
|
|
7705
7697
|
private escapeAttr;
|