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
Change parse mode #16
Change parse mode #16
Conversation
talyguryn
commented
Apr 7, 2021
- use HTML because it is simpler to encode correctly
- message design improvements
a few design improvements
src/index.js
Outdated
@@ -113,7 +148,7 @@ function pullRequestParser(content) { | |||
* @returns {string} - parsed message. | |||
*/ | |||
function issuesParser(content) { | |||
let parsedTask = `[${content.title.replace(/[[\]']+/g, '')}](${content.url})`; | |||
let parsedTask = `${createTaskBadge(content.url)}: <a href="${content.url}">${escapeChars(content.title, '')}</a>`; |
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.
Why escapeChars
contain two arguments.
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.
oh. sorry. have not refactor. i'll fix
src/index.js
Outdated
if (!items.tasks.length) { | ||
return; | ||
} |
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.
@talyguryn, Peter told me earlier to remove this, So we can identify a person without a task.
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.
hm. well then we can mark these people other way. maybe put them at the end of the message and mark as "no task" or any other way.
i did this because i see big message which has only 50% useful information. let's discuss a better design format.
// content.reviewRequests.nodes.forEach((node) => { | ||
// if (node.requestedReviewer.login) { | ||
// parsedTask += `@${node.requestedReviewer.login}`; | ||
// } | ||
// }); | ||
// | ||
// content.assignees.nodes.forEach((node) => { | ||
// if (node.login) { | ||
// parsedTask += `@${node.login}`; | ||
// } | ||
// }); |
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.
Why we removed the requested reviewer and assignees
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.
we can discuss it too. i think it is now necessary to duplicate link to pr. u can see repo name and request name and if it is project which u working for u should check it
message = message.replace(/</g, '<'); | ||
message = message.replace(/>/g, '>'); | ||
message = message.replace(/&/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.
@talyguryn I change this because replaceAll throwing me an error
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.
does it work correctly for multiple entities?
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.
Yup