easychen / pushdeer

开放源码的无App推送服务,iOS14+扫码即用。亦支持快应用/iOS和Mac客户端、Android客户端、自制设备
Other
4.62k stars 468 forks source link

[Bug]兼容<br>换行 #199

Closed GateCross closed 3 months ago

GateCross commented 3 months ago

源码中api/app/Http/Controllers/PushDeerMessageController.php $the_message['desp'] = $validated['desp'];

改为:

$the_message['desp'] = preg_replace("/<br\s*\/?>/", " \n", $validated['desp']); 可以兼容markdown类型的
换行

image
easychen commented 3 months ago

但是
标签不是Markdown而是HTML吧?

GateCross commented 3 months ago

但是 标签不是Markdown而是HTML吧?

{ "text":"测试", "desp":"测试 1
测试123", "type":"text" }type使用 text 后者 markdown 都是无法换行

image
easychen commented 3 months ago


是HTML,你用text/Markdown不能换行不是正常的吗?Markdown语法的换行是两次回车。

GateCross commented 3 months ago

是HTML,你用text/Markdown不能换行不是正常的吗?Markdown语法的换行是两次回车。

HTML 换行需要怎么处理一下比较好,我优化下传入参数