• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marekdedic / prosemirror-remark / 10672399463

02 Sep 2024 07:53PM UTC coverage: 82.311%. Remained the same
10672399463

push

github

web-flow
Merge pull request #363 from marekdedic/eslint-v9

Updated eslint to v9

65 of 115 branches covered (56.52%)

128 of 154 new or added lines in 22 files covered. (83.12%)

1 existing line in 1 file now uncovered.

349 of 424 relevant lines covered (82.31%)

26.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/syntax-extensions/DefinitionExtension.ts
1
import type { Definition } from "mdast";
2
import type { Node as ProseMirrorNode, Schema } from "prosemirror-model";
3

4
import { NodeExtension } from "prosemirror-unified";
8✔
5

6
/**
7
 * @public
8
 */
9
export interface DefinitionExtensionContext {
10
  definitions: Record<
11
    string,
12
    { title: string | null | undefined; url: string }
13
  >;
14
}
15

16
/**
17
 * @public
18
 */
19
export class DefinitionExtension extends NodeExtension<Definition> {
8✔
20
  public override proseMirrorNodeName(): null {
21
    return null;
178✔
22
  }
23

24
  public override proseMirrorNodeSpec(): null {
25
    return null;
12✔
26
  }
27

28
  public override proseMirrorNodeToUnistNodes(): Array<Definition> {
NEW
29
    return [];
×
30
  }
31

32
  public override unistNodeName(): "definition" {
33
    return "definition";
106✔
34
  }
35

36
  public override unistNodeToProseMirrorNodes(
37
    node: Definition,
38
    _proseMirrorSchema: Schema<string, string>,
39
    _convertedChildren: Array<ProseMirrorNode>,
40
    context: Partial<{
41
      DefinitionExtension: DefinitionExtensionContext;
42
    }>,
43
  ): Array<ProseMirrorNode> {
44
    if (context.DefinitionExtension === undefined) {
24✔
45
      context.DefinitionExtension = { definitions: {} };
20✔
46
    }
47
    context.DefinitionExtension.definitions[node.identifier] = {
24✔
48
      title: node.title,
49
      url: node.url,
50
    };
51
    return [];
24✔
52
  }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc