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

fix(pr): fix broken markdown when version contains '|' #6235

Closed
wants to merge 7 commits into from
6 changes: 4 additions & 2 deletions lib/workers/pr/body/updates-table.ts
Expand Up @@ -36,7 +36,7 @@ function getNonEmptyColumns(

export function getPrUpdatesTable(config: BranchConfig): string {
const tableDefinitions = getTableDefinition(config);
const tableValues = config.upgrades.map((upgrade) => {
const tableValues = config.upgrades.map(upgrade => {
const res: Record<string, string> = {};
for (const column of tableDefinitions) {
const { header, value } = column;
Expand All @@ -61,7 +61,9 @@ export function getPrUpdatesTable(config: BranchConfig): string {
for (const row of tableValues) {
let val = '|';
for (const column of tableColumns) {
val += ` ${row[column].replace(/^@/, '@&#8203;')} |`;
val += ' ';
val += row[column].replace(/^@/, '@&#8203;').replace(/\|/g, '\\|');
val += ' |';
}
val += '\n';
rows.push(val);
Expand Down