Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jadanah opened this issue Jul 28, 2022 · 6 comments
Closed

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

jadanah opened this issue Jul 28, 2022 · 6 comments

Comments

@jadanah
Copy link

jadanah commented Jul 28, 2022

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)

@jadanah jadanah changed the title Code Block Highlight No Longer Working As Expected Code Block Highlighting No Longer Working As Expected Jul 28, 2022
@jadanah
Copy link
Author

jadanah commented Aug 3, 2022

Tested also against version 5.0.1 and issue remains, the only workaround is to navigate to /account/preferences and then enable Use legacy message templates within the Global section.

@jadanah jadanah changed the title Code Block Highlighting No Longer Working As Expected v5.0.* Code Block Highlighting No Longer Working As Expected Aug 3, 2022
@ebyrne242
Copy link

I noticed in 5.0.3 that if you put the code block markers on a separate line, it does render the code block properly.

I've also noticed this prior to 5.0 on the android app, not sure exactly when it started. I assume the difference is that there is no option to use the legacy message parser on mobile apps. I believe this bug actually predates 5.0, it's just that users' default message parser was changed when 5.0 was released.

@hugocostadev
Copy link
Contributor

Fixed by RocketChat/fuselage#739

@ebyrne242
Copy link

ebyrne242 commented Sep 14, 2022

Just updated to 5.1.2, which does not fix this.

Here's a screenshot example: First block is three backticks, newline, foo, newline, three backticks. Second block is three backticks, foo, three backticks.

With the new message template:

image

With the legacy message template, both code blocks display properly.

@jadanah
Copy link
Author

jadanah commented Oct 5, 2022

Do we know if this will be in the 5.2.0 release?

@ebyrne242
Copy link

Apparently not, as 5.3.0 is still broken. Do we know if it will be in 5.4.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants