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

Escape pipe char of commit msg in markdown table #515

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

Conversation

kertal
Copy link

@kertal kertal commented Sep 24, 2024

When a commit message contains a | character, this breaks the "All backports failed" comment in GitHub, due to the | character is part of the table markdown. With this PR | is escaped with \| to ensure the commit message and link are displayed correctly

resolves #512

})`;
const msg = getFirstLine(c.commit.sourceCommit.message);
// make sure to escape the pipe character to ensure the markdown table is correct
const msgEscaped = msg.replace(/\|/g, '\\|');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
@sorenlouv
Copy link
Owner

lgtm. Any thoughts on the codeql warning?

@kertal
Copy link
Author

kertal commented Sep 27, 2024

@sorenlouv didn't have time, but will have a look, and then flag it as ready for review 👍

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.

PR titles which include pipe throw off the merge hints
2 participants