@dogsbay/format-dita 0.2.0-beta.121 → 0.2.0-beta.123

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/README.md CHANGED
@@ -3,6 +3,12 @@
3
3
  Convert DITA topic XML to Dogsbay's TreeNode model — and, composed with
4
4
  `@dogsbay/format-dogsbay-md`, straight to markdown.
5
5
 
6
+ **Browser-safe:** the package imports no Node built-ins, so it bundles for a
7
+ browser or a Worker (a test bundles it with esbuild for `platform: "browser"`).
8
+ Malformed XML is reported, not repaired silently: the parser would close an
9
+ unclosed element for you, so a `<xml>` note gives the first problem and its
10
+ line (`checkWellFormed` is exported too).
11
+
6
12
  ```ts
7
13
  import { ditaTopicToDogsbayMd } from "@dogsbay/format-dita";
8
14
 
package/dist/anchors.d.ts CHANGED
@@ -17,4 +17,3 @@ export declare const anchorId: (ctx: {
17
17
  topicId?: string;
18
18
  anchorIds?: Map<string, string>;
19
19
  }, id: string) => string;
20
- //# sourceMappingURL=anchors.d.ts.map
package/dist/anchors.js CHANGED
@@ -32,4 +32,3 @@ export const renamedElementIds = (nodes) => {
32
32
  };
33
33
  /** The anchor for an element id in a topic: the id, or `topicid__elementid` when an earlier topic has it. */
34
34
  export const anchorId = (ctx, id) => (ctx.topicId !== undefined && ctx.anchorIds?.get(`${ctx.topicId}/${id}`)) || id;
35
- //# sourceMappingURL=anchors.js.map
package/dist/blocks.d.ts CHANGED
@@ -7,10 +7,11 @@
7
7
  * provenance (the dogsbay-md round-trip contract); constructs TreeNode
8
8
  * cannot carry are recorded as conversion notes.
9
9
  */
10
- import type { Element } from "domhandler";
10
+ import type { Element, AnyNode } from "domhandler";
11
11
  import type { TreeNode } from "@dogsbay/types";
12
12
  import { type InlineContext } from "./inline.js";
13
13
  import { type ConrefSiteContext, type ConrefSnippetRef } from "./types.js";
14
+ import { DB_QUALIFIERS } from "./qualifiers.js";
14
15
  export interface BlockContext extends InlineContext {
15
16
  /** Current heading depth for <section>/<example> titles. */
16
17
  headingLevel: number;
@@ -22,6 +23,8 @@ export interface BlockContext extends InlineContext {
22
23
  * snippets.
23
24
  */
24
25
  constrained?: boolean;
26
+ /** Inside a table cell: a collapsible block has no place there */
27
+ inTableCell?: boolean;
25
28
  }
26
29
  /**
27
30
  * The include directive for a snippet, wrapped in a scoped leveloffset
@@ -29,6 +32,7 @@ export interface BlockContext extends InlineContext {
29
32
  * from the snippet's baked-in base level.
30
33
  */
31
34
  export declare const includeDirective: (snippet: ConrefSnippetRef, site: ConrefSiteContext, headingLevel: number) => string;
35
+ export { DB_QUALIFIERS };
32
36
  /**
33
37
  * One <step>/<substep>'s content: <cmd> as the leading inline run, the
34
38
  * rest as block children. Shared by convertSteps (constrained context)
@@ -56,5 +60,6 @@ export declare const isBlockTarget: (name: string) => boolean;
56
60
  * DITA-OT's pages. (Headings carry their own id.)
57
61
  */
58
62
  export declare function convertBlock(el: Element, ctx: BlockContext): TreeNode[];
59
- export declare function convertChildren(el: Element, ctx: BlockContext, skip?: Set<string>): TreeNode[];
60
- //# sourceMappingURL=blocks.d.ts.map
63
+ export declare function convertChildren(el: Element, ctx: BlockContext,
64
+ /** Element names, or particular child nodes, to leave out */
65
+ skip?: Set<string | AnyNode>): TreeNode[];