Skip to content

Commit

Permalink
fix(pr): fix broken markdown when version contains '|'
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed May 14, 2020
1 parent 61c4fcd commit 92ce4aa
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 92ce4aa

Please sign in to comment.