oast-to-hast 4.4.2 → 4.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.
@@ -31,6 +31,7 @@ export const handlers: {
31
31
  footnote: typeof footnote;
32
32
  'footnote.reference': typeof footnoteRef;
33
33
  hr: typeof hr;
34
+ newline: typeof newline;
34
35
  };
35
36
  import { document } from './document.js';
36
37
  import { keyword } from './keyword.js';
@@ -54,5 +55,6 @@ declare function passThrough(state: import("../state.js").State, node: any, pare
54
55
  import { footnote } from './footnote.js';
55
56
  import { footnoteRef } from './footnote.js';
56
57
  import { hr } from './hr.js';
58
+ import { newline } from './newline.js';
57
59
  export {};
58
60
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BC;yBAnCwB,eAAe;wBAlBhB,cAAc;yBACb,eAAe;wBAOhB,cAAc;0BANZ,gBAAgB;qBACrB,WAAW;sBAEV,YAAY;sBAEZ,YAAY;qBAHb,WAAW;qBAMiB,WAAW;iCAAX,WAAW;;yBAAX,WAAW;sBAOrD,YAAY;gCAAZ,YAAY;kCAAZ,YAAY;8BAAZ,YAAY;qBAXE,WAAW;;yBAKM,eAAe;4BAAf,eAAe;mBAFlC,SAAS"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BC;yBApCwB,eAAe;wBAnBhB,cAAc;yBACb,eAAe;wBAOhB,cAAc;0BANZ,gBAAgB;qBACrB,WAAW;sBAEV,YAAY;sBAEZ,YAAY;qBAHb,WAAW;qBAMiB,WAAW;iCAAX,WAAW;;yBAAX,WAAW;sBAQrD,YAAY;gCAAZ,YAAY;kCAAZ,YAAY;8BAAZ,YAAY;qBAZE,WAAW;;yBAKM,eAAe;4BAAf,eAAe;mBAFlC,SAAS;wBAGJ,cAAc"}
@@ -10,6 +10,7 @@ import { section } from './section.js'
10
10
  import { hr } from './hr.js'
11
11
  import { checkbox, list, item as listItem } from './list.js'
12
12
  import { footnote, footnoteRef } from './footnote.js'
13
+ import { newline } from './newline.js'
13
14
  import {
14
15
  table,
15
16
  cell as tableCell,
@@ -51,6 +52,7 @@ export const handlers = {
51
52
  footnote,
52
53
  'footnote.reference': footnoteRef,
53
54
  hr,
55
+ newline,
54
56
  }
55
57
 
56
58
  /** @type {import('../state.js').Handler} */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @param {import('../state.js').State} _state
3
+ * @param {import('orga').Newline} _node
4
+ * @param {import('orga').Parent | undefined} parent
5
+ * @returns {import('hast').Text | undefined}
6
+ */
7
+ export function newline(_state: import("../state.js").State, _node: import("orga").Newline, parent: import("orga").Parent | undefined): import("hast").Text | undefined;
8
+ //# sourceMappingURL=newline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"newline.d.ts","sourceRoot":"","sources":["newline.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,gCALW,OAAO,aAAa,EAAE,KAAK,SAC3B,OAAO,MAAM,EAAE,OAAO,UACtB,OAAO,MAAM,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,MAAM,EAAE,IAAI,GAAG,SAAS,CAU3C"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param {import('../state.js').State} _state
3
+ * @param {import('orga').Newline} _node
4
+ * @param {import('orga').Parent | undefined} parent
5
+ * @returns {import('hast').Text | undefined}
6
+ */
7
+ export function newline(_state, _node, parent) {
8
+ // In Org paragraphs, a single source newline is a soft break. For HTML
9
+ // output, normalize it to a space so text remains readable.
10
+ if (parent?.type === 'paragraph') {
11
+ return { type: 'text', value: ' ' }
12
+ }
13
+
14
+ return undefined
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oast-to-hast",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "description": "Transform OAST to HAST",
5
5
  "files": [
6
6
  "lib",