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

Update Whois to remove the leading space in front of email #470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

earlduque
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@chelming chelming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could do it all in one line with

message_body = message_body.replace(/^\s*/gm,'').match(/^(real_name|tz_label|email):.*$/gm).join('\n');

if any other fields get added we wouldn't have to worry about leading spaces then 🤷

or just change the replace line in yours to .replace(/^\s*/gm,'')

@@ -37,6 +37,7 @@ if (current.channel == "GD51HTR46" || current.channel == "G9LAJG7G8" || current.
}

message_body = message_body.match(/^(real_name|tz_label| {2}email):.*$/gm).join('\n');
message_body = message_body.replace(/^\s{2}(email)/gm, '$1');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could trim before joining in case we ever have other indented lines.

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

Successfully merging this pull request may close these issues.

3 participants