document-ir 0.4.2 → 0.4.3

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.
@@ -1,11 +1,13 @@
1
1
  import { IdentityTransformer } from './IdentityTransformer.ts';
2
- import { CodeNode, DocumentNode, Node, TextNode } from './types.ts';
2
+ import { BadgeNode, CodeNode, DocumentNode, EmojiNode, Node, TextNode } from './types.ts';
3
3
  export declare class WhitespaceTransformer extends IdentityTransformer {
4
4
  private stripWhitespace;
5
5
  private lastText;
6
6
  constructor();
7
7
  protected text(node: TextNode): Promise<Node | null>;
8
8
  private stripLastText;
9
+ protected emoji(node: EmojiNode): Promise<Node | null>;
10
+ protected badge(node: BadgeNode): Promise<Node | null>;
9
11
  protected code(node: CodeNode): Promise<Node | null>;
10
12
  protected beforeBlock(): Promise<void>;
11
13
  protected afterBlock(): Promise<void>;
package/dist/index.js CHANGED
@@ -915,7 +915,14 @@ class T extends u {
915
915
  stripLastText() {
916
916
  this.lastText && (this.lastText.text.endsWith(" ") && (this.lastText.text = this.lastText.text.slice(0, -1)), this.lastText = null), this.stripWhitespace = !0;
917
917
  }
918
+ async emoji(e) {
919
+ return this.lastText = null, this.stripWhitespace = !1, await super.emoji(e);
920
+ }
921
+ async badge(e) {
922
+ return this.lastText = null, this.stripWhitespace = !1, await super.badge(e);
923
+ }
918
924
  async code(e) {
925
+ this.lastText = null, this.stripWhitespace = !1;
919
926
  const i = {
920
927
  type: "code",
921
928
  content: e.content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-ir",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",