@gmb/bitmark-parser-generator 5.39.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.
@@ -6,6 +6,7 @@ declare const BitType: {
6
6
  readonly _error: "_error";
7
7
  readonly _comment: "_comment";
8
8
  readonly _standard: "_standard";
9
+ readonly _standardLight: "_standard-light";
9
10
  readonly advertising: "advertising";
10
11
  readonly advertisingAdvertorial: "advertising-advertorial";
11
12
  readonly advertisingAdvertorialPage: "advertising-advertorial-page";
@@ -293,6 +294,7 @@ declare const BitType: {
293
294
  readonly handInSystemMedia: "hand-in-system-media";
294
295
  readonly handInVideo: "hand-in-video";
295
296
  readonly handInVoice: "hand-in-voice";
297
+ readonly h: "h";
296
298
  readonly help: "help";
297
299
  readonly helpAlt: "help-alt";
298
300
  readonly highlightText: "highlight-text";
@@ -378,6 +380,7 @@ declare const BitType: {
378
380
  readonly leWatchVideoEmbed: "le-watch-video-embed";
379
381
  readonly lifeSkillSticker: "life-skill-sticker";
380
382
  readonly list: "list";
383
+ readonly listAlt: "list-alt";
381
384
  readonly listItem: "list-item";
382
385
  readonly mark: "mark";
383
386
  readonly match: "match";
@@ -408,6 +411,8 @@ declare const BitType: {
408
411
  readonly notebookArticle: "notebook-article";
409
412
  readonly noteCollapsible: "note-collapsible";
410
413
  readonly output: "output";
414
+ readonly p: "p";
415
+ readonly pAlt: "p-alt";
411
416
  readonly page: "page";
412
417
  readonly pageAcademy: "page-academy";
413
418
  readonly pageArticle: "page-article";
@@ -530,6 +535,7 @@ declare const BitType: {
530
535
  readonly smartStandardNoteNonNormativeCollapsible: "smart-standard-note-non-normative-collapsible";
531
536
  readonly smartStandardNoteNormative: "smart-standard-note-normative";
532
537
  readonly smartStandardNoteNormativeCollapsible: "smart-standard-note-normative-collapsible";
538
+ readonly smartStandardP: "smart-standard-p";
533
539
  readonly smartStandardRemarkLegend: "smart-standard-remark-legend";
534
540
  readonly smartStandardRemarkLegendNonNormative: "smart-standard-remark-legend-non-normative";
535
541
  readonly smartStandardRemarkLegendNormative: "smart-standard-remark-legend-normative";
@@ -708,6 +714,8 @@ type BitTagConfigKeyTypeType = EnumType<typeof BitTagConfigKeyType>;
708
714
  declare const ConfigKey: {
709
715
  readonly group_accessibilityDecorative: "group_accessibilityDecorative";
710
716
  readonly group_standardAllBits: "group_standardAllBits";
717
+ readonly group_standardExample: "group_standardExample";
718
+ readonly group_standardItem: "group_standardItem";
711
719
  readonly group_standardItemLead: "group_standardItemLead";
712
720
  readonly group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint";
713
721
  readonly group_standardInstructionHint: "group_standardInstructionHint";
@@ -4069,6 +4077,8 @@ type GenerateOptions = {
4069
4077
  noBreakscaping?: boolean;
4070
4078
  forceInline?: boolean;
4071
4079
  noMarkup?: boolean;
4080
+ /** The AST is a chain value (footnote content): only plain text and short-form marks */
4081
+ chainValueContext?: boolean;
4072
4082
  };
4073
4083
  declare const Stage: {
4074
4084
  enter: string;
@@ -4078,9 +4088,6 @@ declare const Stage: {
4078
4088
  type StageType = EnumType<typeof Stage>;
4079
4089
  type WriteCallback = (s: string) => void;
4080
4090
  type BodyBitCallback = (bodyBit: BodyBitJson, index: number, route: NodeInfo[]) => string;
4081
- interface MediaAttributeOptions {
4082
- ignoreAttributes?: Set<string>;
4083
- }
4084
4091
  /**
4085
4092
  * Generate text from a bitmark text AST
4086
4093
  */
@@ -4106,6 +4113,8 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4106
4113
  private textDepth;
4107
4114
  private placeholderIndex;
4108
4115
  private placeholders;
4116
+ private chainJustClosed;
4117
+ private simpleLinkAllowed;
4109
4118
  private rootParagraphNodeContentIndex;
4110
4119
  private previousRootParagraphContextType;
4111
4120
  private inPreText;
@@ -4178,6 +4187,11 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4178
4187
  * @returns true if a simple link, otherwise false
4179
4188
  */
4180
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;
4181
4195
  /**
4182
4196
  * Get the link text if the node is a link, otherwise return false
4183
4197
  *
@@ -4216,24 +4230,12 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4216
4230
  protected writeParagraph(node: TextNode, route: NodeInfo[]): void;
4217
4231
  protected writeHardBreak(_node: TextNode): void;
4218
4232
  protected writeHeading(node: HeadingTextNode): void;
4219
- protected writeSection(node: SectionTextNode): void;
4220
4233
  protected writeBullet(node: TextNode, route: NodeInfo[]): void;
4221
4234
  protected writeImage(node: ImageTextNode | ImageInlineTextNode): void;
4222
4235
  protected writeCodeBlock(node: CodeBlockTextNode): void;
4223
4236
  protected writeLatex(node: LatexTextNode): void;
4224
4237
  protected writeMarkTextWrapper(s: string): void;
4225
4238
  protected writeInlineMark(mark: TextMark): void;
4226
- /**
4227
- * Resolve the marks of a text node into the marks that will actually be written.
4228
- *
4229
- * - Merges a legacy standalone 'duration' mark into its sibling 'timer' mark.
4230
- * - Drops marks the current grammar cannot express (standalone 'duration', 'timer'
4231
- * without a duration).
4232
- * - Moves a 'textStyle'/'color' mark before a preceding bare 'highlight'/'userHighlight'
4233
- * mark when its color is a valid highlight color; written in the original order the
4234
- * output would re-parse as a highlight-with-color compound mark and change meaning.
4235
- */
4236
- protected getWritableMarks(nodeMarks: TextMark[]): TextMark[];
4237
4239
  /**
4238
4240
  * True if the mark is written using its standard form (e.g. **bold**, !!highlight!!)
4239
4241
  * when it is the only mark. A highlight mark with a color attribute is excluded - it
@@ -4261,7 +4263,6 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4261
4263
  close?: boolean;
4262
4264
  single?: boolean;
4263
4265
  }): void;
4264
- protected getMediaAttrs(mediaType: string, attrs: MediaAttributes, options?: MediaAttributeOptions): string | undefined;
4265
4266
  protected breakscape(s: string, options: BreakscapeOptions$1): string;
4266
4267
  protected getBitType(route: NodeInfo[]): BitTypeType | undefined;
4267
4268
  /**
@@ -7691,7 +7692,6 @@ declare class HtmlTableGenerator {
7691
7692
  private listItemToHtml;
7692
7693
  private imageToHtml;
7693
7694
  private textToHtml;
7694
- private inlineImageTokenToHtml;
7695
7695
  private latexToHtml;
7696
7696
  private escapeText;
7697
7697
  private escapeAttr;
@@ -6,6 +6,7 @@ declare const BitType: {
6
6
  readonly _error: "_error";
7
7
  readonly _comment: "_comment";
8
8
  readonly _standard: "_standard";
9
+ readonly _standardLight: "_standard-light";
9
10
  readonly advertising: "advertising";
10
11
  readonly advertisingAdvertorial: "advertising-advertorial";
11
12
  readonly advertisingAdvertorialPage: "advertising-advertorial-page";
@@ -293,6 +294,7 @@ declare const BitType: {
293
294
  readonly handInSystemMedia: "hand-in-system-media";
294
295
  readonly handInVideo: "hand-in-video";
295
296
  readonly handInVoice: "hand-in-voice";
297
+ readonly h: "h";
296
298
  readonly help: "help";
297
299
  readonly helpAlt: "help-alt";
298
300
  readonly highlightText: "highlight-text";
@@ -378,6 +380,7 @@ declare const BitType: {
378
380
  readonly leWatchVideoEmbed: "le-watch-video-embed";
379
381
  readonly lifeSkillSticker: "life-skill-sticker";
380
382
  readonly list: "list";
383
+ readonly listAlt: "list-alt";
381
384
  readonly listItem: "list-item";
382
385
  readonly mark: "mark";
383
386
  readonly match: "match";
@@ -408,6 +411,8 @@ declare const BitType: {
408
411
  readonly notebookArticle: "notebook-article";
409
412
  readonly noteCollapsible: "note-collapsible";
410
413
  readonly output: "output";
414
+ readonly p: "p";
415
+ readonly pAlt: "p-alt";
411
416
  readonly page: "page";
412
417
  readonly pageAcademy: "page-academy";
413
418
  readonly pageArticle: "page-article";
@@ -530,6 +535,7 @@ declare const BitType: {
530
535
  readonly smartStandardNoteNonNormativeCollapsible: "smart-standard-note-non-normative-collapsible";
531
536
  readonly smartStandardNoteNormative: "smart-standard-note-normative";
532
537
  readonly smartStandardNoteNormativeCollapsible: "smart-standard-note-normative-collapsible";
538
+ readonly smartStandardP: "smart-standard-p";
533
539
  readonly smartStandardRemarkLegend: "smart-standard-remark-legend";
534
540
  readonly smartStandardRemarkLegendNonNormative: "smart-standard-remark-legend-non-normative";
535
541
  readonly smartStandardRemarkLegendNormative: "smart-standard-remark-legend-normative";
@@ -708,6 +714,8 @@ type BitTagConfigKeyTypeType = EnumType<typeof BitTagConfigKeyType>;
708
714
  declare const ConfigKey: {
709
715
  readonly group_accessibilityDecorative: "group_accessibilityDecorative";
710
716
  readonly group_standardAllBits: "group_standardAllBits";
717
+ readonly group_standardExample: "group_standardExample";
718
+ readonly group_standardItem: "group_standardItem";
711
719
  readonly group_standardItemLead: "group_standardItemLead";
712
720
  readonly group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint";
713
721
  readonly group_standardInstructionHint: "group_standardInstructionHint";
@@ -4069,6 +4077,8 @@ type GenerateOptions = {
4069
4077
  noBreakscaping?: boolean;
4070
4078
  forceInline?: boolean;
4071
4079
  noMarkup?: boolean;
4080
+ /** The AST is a chain value (footnote content): only plain text and short-form marks */
4081
+ chainValueContext?: boolean;
4072
4082
  };
4073
4083
  declare const Stage: {
4074
4084
  enter: string;
@@ -4078,9 +4088,6 @@ declare const Stage: {
4078
4088
  type StageType = EnumType<typeof Stage>;
4079
4089
  type WriteCallback = (s: string) => void;
4080
4090
  type BodyBitCallback = (bodyBit: BodyBitJson, index: number, route: NodeInfo[]) => string;
4081
- interface MediaAttributeOptions {
4082
- ignoreAttributes?: Set<string>;
4083
- }
4084
4091
  /**
4085
4092
  * Generate text from a bitmark text AST
4086
4093
  */
@@ -4106,6 +4113,8 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4106
4113
  private textDepth;
4107
4114
  private placeholderIndex;
4108
4115
  private placeholders;
4116
+ private chainJustClosed;
4117
+ private simpleLinkAllowed;
4109
4118
  private rootParagraphNodeContentIndex;
4110
4119
  private previousRootParagraphContextType;
4111
4120
  private inPreText;
@@ -4178,6 +4187,11 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4178
4187
  * @returns true if a simple link, otherwise false
4179
4188
  */
4180
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;
4181
4195
  /**
4182
4196
  * Get the link text if the node is a link, otherwise return false
4183
4197
  *
@@ -4216,24 +4230,12 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4216
4230
  protected writeParagraph(node: TextNode, route: NodeInfo[]): void;
4217
4231
  protected writeHardBreak(_node: TextNode): void;
4218
4232
  protected writeHeading(node: HeadingTextNode): void;
4219
- protected writeSection(node: SectionTextNode): void;
4220
4233
  protected writeBullet(node: TextNode, route: NodeInfo[]): void;
4221
4234
  protected writeImage(node: ImageTextNode | ImageInlineTextNode): void;
4222
4235
  protected writeCodeBlock(node: CodeBlockTextNode): void;
4223
4236
  protected writeLatex(node: LatexTextNode): void;
4224
4237
  protected writeMarkTextWrapper(s: string): void;
4225
4238
  protected writeInlineMark(mark: TextMark): void;
4226
- /**
4227
- * Resolve the marks of a text node into the marks that will actually be written.
4228
- *
4229
- * - Merges a legacy standalone 'duration' mark into its sibling 'timer' mark.
4230
- * - Drops marks the current grammar cannot express (standalone 'duration', 'timer'
4231
- * without a duration).
4232
- * - Moves a 'textStyle'/'color' mark before a preceding bare 'highlight'/'userHighlight'
4233
- * mark when its color is a valid highlight color; written in the original order the
4234
- * output would re-parse as a highlight-with-color compound mark and change meaning.
4235
- */
4236
- protected getWritableMarks(nodeMarks: TextMark[]): TextMark[];
4237
4239
  /**
4238
4240
  * True if the mark is written using its standard form (e.g. **bold**, !!highlight!!)
4239
4241
  * when it is the only mark. A highlight mark with a color attribute is excluded - it
@@ -4261,7 +4263,6 @@ declare class TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedStrin
4261
4263
  close?: boolean;
4262
4264
  single?: boolean;
4263
4265
  }): void;
4264
- protected getMediaAttrs(mediaType: string, attrs: MediaAttributes, options?: MediaAttributeOptions): string | undefined;
4265
4266
  protected breakscape(s: string, options: BreakscapeOptions$1): string;
4266
4267
  protected getBitType(route: NodeInfo[]): BitTypeType | undefined;
4267
4268
  /**
@@ -7691,7 +7692,6 @@ declare class HtmlTableGenerator {
7691
7692
  private listItemToHtml;
7692
7693
  private imageToHtml;
7693
7694
  private textToHtml;
7694
- private inlineImageTokenToHtml;
7695
7695
  private latexToHtml;
7696
7696
  private escapeText;
7697
7697
  private escapeAttr;