Skip to content

v5.0.* Code Block Highlighting No Longer Working As Expected #26388

@jadanah

Description

@jadanah

There seems to be an issue when rendering a code block

e.g. if I post to api/v1/chat.postMessage

{"channel":"testing","text":"```yaml\r\n\"Channel\": \"testing\"\r\n\"Guid\": \"66a242b6-6dc4-4c60-81c2-964d274e39df\"\r\n```"}

response:

{"ts":1658738843882,"channel":"testing","message":{"alias":"","msg":"```yaml\r\n\"Channel\": \"testing\"\r\n\"Guid\": \"66a242b6-6dc4-4c60-81c2-964d274e39df\"\r\n```","attachments":[],"parseUrls":true,"groupable":false,"ts":"2022-07-25T08:47:23.748Z","u":{"_id":"f7KxnCCiJn96KAWFG","username":"ukgd.toolkit","name":"UKGD ToolKit"},"rid":"7BtzSPWzf2MQAJkbD","unread":true,"_id":"u9HQTfxNpTarvXSyZ","_updatedAt":"2022-07-25T08:47:23.829Z","urls":[],"mentions":[],"channels":[],"md":[{"type":"PARAGRAPH","value":[{"type":"PLAIN_TEXT","value":"```yaml"}]},{"type":"PARAGRAPH","value":[{"type":"PLAIN_TEXT","value":"\"Channel\": \"testing\""}]},{"type":"PARAGRAPH","value":[{"type":"PLAIN_TEXT","value":"\"Guid\": \"66a242b6-6dc4-4c60-81c2-964d274e39df\""}]},{"type":"PARAGRAPH","value":[{"type":"PLAIN_TEXT","value":"```"}]}]},"success":true}

without legacy messages:
Screenshot 2022-07-25 094910

then the code block wont be highlighted unless I activate "Enable Legacy Messages"

with legacy messages:
Screenshot 2022-07-25 094952

Version
5.0.0-rc.12
Apps Engine Version
1.33.0
Node Version
v14.19.3
Database Migration
279 (July 25, 2022 9:14 AM)
MongoDB
5.0.9 / wiredTiger (oplog Enabled)
Commit Details
HEAD: (6a0fea4e1)
Branch: HEAD

Originally posted by @jadanah in #23971 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions