pi-lxmf 0.2.0 → 0.2.1
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/CHANGELOG.md +9 -0
- package/SPEC.md +4 -0
- package/package.json +1 -1
- package/src/lxmf.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.1] - 2026-09-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Outbound LXMF messages now signal their content format: every content
|
|
15
|
+
chunk carries the `FIELD_RENDERER` field set to `RENDERER_MARKDOWN`, so
|
|
16
|
+
clients (Sideband, NomadNet) render pi's Markdown replies correctly
|
|
17
|
+
instead of showing raw markup as plain text.
|
|
18
|
+
|
|
10
19
|
## [0.2.0] - 2026-09-27
|
|
11
20
|
|
|
12
21
|
### Added
|
package/SPEC.md
CHANGED
|
@@ -181,6 +181,10 @@ example:
|
|
|
181
181
|
paragraph boundaries where possible, each chunk suffixed
|
|
182
182
|
`[… n/N]` except the last. Chunking keeps single LXMF messages
|
|
183
183
|
reasonable for phone UIs and for mesh airtime.
|
|
184
|
+
- **Content format:** every chunk carries the LXMF `FIELD_RENDERER` field
|
|
185
|
+
set to `RENDERER_MARKDOWN` (§5.9.4), since pi's replies are Markdown —
|
|
186
|
+
clients (Sideband, NomadNet) use it to render them instead of showing
|
|
187
|
+
raw markup as plain text.
|
|
184
188
|
- **Errors:** failures to deliver a reply are logged and retried once;
|
|
185
189
|
persistent failure is reported in the next successful message (LXMF has
|
|
186
190
|
no channel over which to report its own failure).
|
package/package.json
CHANGED
package/src/lxmf.js
CHANGED
|
@@ -53,6 +53,20 @@ export function isUnknownIdentityError(e) {
|
|
|
53
53
|
return e instanceof Error && UNKNOWN_IDENTITY_MESSAGE.test(e.message);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Builds the fields map signaling the outbound message content format
|
|
58
|
+
* (FIELD_RENDERER, SPEC §5.9.4): pi's replies are Markdown, and clients
|
|
59
|
+
* such as Sideband only render them as such when the field says so —
|
|
60
|
+
* without it they show raw `**bold**`/backtick fences as plain text.
|
|
61
|
+
*
|
|
62
|
+
* @returns {Map<number, number>} `{FIELD_RENDERER: RENDERER_MARKDOWN}`
|
|
63
|
+
*/
|
|
64
|
+
export function contentFields() {
|
|
65
|
+
const fields = new Map();
|
|
66
|
+
fields.set(LXMFConstants.FIELD_RENDERER, LXMFConstants.RENDERER_MARKDOWN);
|
|
67
|
+
return fields;
|
|
68
|
+
}
|
|
69
|
+
|
|
56
70
|
/**
|
|
57
71
|
* Waits until `transport` can recall the identity for `destinationHash`,
|
|
58
72
|
* soliciting it first: a path request makes the destination itself (or any
|
|
@@ -526,6 +540,7 @@ export async function startLxmf(config, options = {}) {
|
|
|
526
540
|
sourceHash: /** @type {Uint8Array} */ (deliveryDest.destinationHash),
|
|
527
541
|
destinationHash: fromHex(destinationHex),
|
|
528
542
|
content,
|
|
543
|
+
fields: contentFields(),
|
|
529
544
|
...(i === 0 && sendOptions.title ? { title: sendOptions.title } : {}),
|
|
530
545
|
});
|
|
531
546
|
await sendWithRetry(message, sendOptions.link);
|