openclaw - 💡(How to fix) Fix [Bug] 2026.3.24 版本输出消息换行符被强制合并,段落空行丢失 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56844Fetched 2026-04-08 01:47:04
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

Bug描述

升级到2026.3.24版本后,所有输出消息的换行符被强制合并,段落之间的空行被自动移除,不管发送到飞书/企业微信/WhatsApp哪个通道,都无法显示段落间隔,所有内容挤成一坨,严重影响可读性。

复现步骤

  1. 升级到2026.3.24版本
  2. 发送任意包含多段落(段之间空行)的回复消息到任意通道
  3. 查看收到的消息,空行全部被合并,段落没有间隔

预期结果

保留用户输出的换行和空行格式,段落之间有明显间隔

实际结果

所有连续换行被合并为单个换行,段落之间没有空行

版本信息

OpenClaw版本:2026.3.24 运行系统:macOS 14.4 部署方式:桌面客户端

extent analysis

Fix Plan

The fix involves modifying the message formatting to preserve line breaks and paragraph spacing.

  • Update the message processing code to replace line breaks with HTML line breaks (<br>) or Markdown line breaks (\n) before sending the message.
  • Ensure that the messaging channels (飞书, 企业微信, WhatsApp) support HTML or Markdown formatting.

Example code snippet (in Python):

import re

def format_message(message):
    # Replace line breaks with HTML line breaks
    message = re.sub(r'\n', '<br>', message)
    # Replace multiple line breaks with a single line break
    message = re.sub(r'<br><br>', '<br>', message)
    return message

# Example usage:
message = "Hello\n\nWorld!"
formatted_message = format_message(message)
print(formatted_message)

Alternatively, you can use Markdown formatting:

import re

def format_message(message):
    # Replace line breaks with Markdown line breaks
    message = re.sub(r'\n', '\n', message)
    # Add two spaces at the end of each line to preserve line breaks
    message = re.sub(r'([^\n])\n', r'\1  \n', message)
    return message

# Example usage:
message = "Hello\n\nWorld!"
formatted_message = format_message(message)
print(formatted_message)

Verification

Test the updated code by sending a message with multiple paragraphs and verifying that the line breaks and paragraph spacing are preserved.

Extra Tips

  • Ensure that the messaging channels support HTML or Markdown formatting.
  • Test the updated code with different messaging channels to ensure compatibility.
  • Consider adding a configuration option to allow users to choose between HTML and Markdown formatting.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING