OverviewFilesCommitsIssuesDocsReleasesPeers

wirecore commits / dfa16c9

Fix YAML format: Add opening --- delimiter for wiredove compatibility
Bug: Posts on pub.wiredove.net showed raw metadata in message Cause: Missing opening --- delimiter in YAML frontmatter Before (incorrect): name: tabertron previous: ... --- Message content After (correct): --- name: tabertron previous: ... --- Message content Changes: - YAMLHelper.create() now adds opening --- delimiter - YAMLHelper.parse() skips opening --- when parsing - Matches wiredove-cli YAML format exactly Tested: ✅ Post created with correct YAML format ✅ Pushed to relay successfully ✅ Verified on pub.wiredove.net with correct format ✅ Timeline parsing still works (shows content only) Released: v4238 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
dfa16c961ad808b757b86e848fb94f68080a6717
by plankatron <fleeky@gmail.com> · 2026-01-22T19:01:20.000Z

Changed files (1) +17 -16

pear-app/lib/yaml-helper.js +17 -16
……@@ -15,28 +15,26 @@ export class YAMLHelper {
1515 */
1616 static create(metadata, content) {
1717 const lines = []
18
18
19 // Start with opening delimiter (standard YAML frontmatter)
20 lines.push('---')
21
1922 if (metadata.name) {
2023 lines.push(`name: ${metadata.name}`)
2124 }
22
25
2326 if (metadata.image) {
2427 lines.push(`image: ${metadata.image}`)
2528 }
26
29
2730 if (metadata.previous) {
2831 lines.push(`previous: ${metadata.previous}`)
2932 }
30
31 if (lines.length === 0) {
32 // No metadata, just return content
33 return content
34 }
35
36 // Add separator and content
33
34 // Add closing delimiter and content
3735 lines.push('---')
3836 lines.push(content)
39
37
4038 return lines.join('\n')
4139 }
4240
……@@ -45,7 +43,7 @@ export class YAMLHelper {
4543 */
4644 static parse(yaml) {
4745 const parts = yaml.split('\n---\n')
48
46
4947 if (parts.length === 1) {
5048 // No metadata, just content
5149 return {
……@@ -53,21 +51,24 @@ export class YAMLHelper {
5351 content: yaml
5452 }
5553 }
56
54
5755 const [frontMatter, ...contentParts] = parts
5856 const content = contentParts.join('\n---\n')
59
57
6058 const metadata = {}
6159 const lines = frontMatter.split('\n')
62
60
6361 for (const line of lines) {
62 // Skip the opening --- delimiter
63 if (line.trim() === '---') continue
64
6465 const match = line.match(/^(\w+):\s*(.+)$/)
6566 if (match) {
6667 const [, key, value] = match
6768 metadata[key] = value
6869 }
6970 }
70
71
7172 return { metadata, content }
7273 }
7374}