-
Notifications
You must be signed in to change notification settings - Fork 681
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
Render MOTD with a single message #2059
Conversation
c583686
to
e961ddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, that is so much nicer!!
Small comment about adding a test then all good.
@@ -93,8 +93,7 @@ function buildChatMessage(msg) { | |||
msg.highlight = true; | |||
} | |||
|
|||
if (constants.actionTypes.indexOf(type) !== -1) { | |||
msg.template = "actions/" + type; | |||
if (typeof templates.actions[type] !== "undefined") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool. This was long-overdue! 👏
@@ -19,7 +19,8 @@ const colorRx = /^(\d{1,2})(?:,(\d{1,2}))?/; | |||
const hexColorRx = /^([0-9a-f]{6})(?:,([0-9a-f]{6}))?/i; | |||
|
|||
// Represents all other control codes that to be ignored/filtered from the text | |||
const controlCodesRx = /[\u0000-\u001F]/g; | |||
// This regex allows line feed character | |||
const controlCodesRx = /[\u0000-\u0009\u000B-\u001F]/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you could add a test for this regex change? 🙏 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
Instead of splitting it on server and creating
Msg
for every line, just let keep the newlines inparse
and let CSS render it correctly.