From 89bdc1a40e7b701b5fcb5eb2e112d1371ba7b4f2 Mon Sep 17 00:00:00 2001 From: Robert Axelsen Date: Thu, 1 Aug 2019 17:36:27 +0200 Subject: [PATCH] fix(compiler): change props union type parsing --- src/compiler/docs/readme/docs-util.ts | 2 +- src/compiler/docs/test/markdown-props.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/docs/readme/docs-util.ts b/src/compiler/docs/readme/docs-util.ts index cb4d9e1bbf9..c7f1c9b69e2 100644 --- a/src/compiler/docs/readme/docs-util.ts +++ b/src/compiler/docs/readme/docs-util.ts @@ -34,7 +34,7 @@ export class MarkdownTable { function escapeMarkdownTableColumn(text: string) { text = text.replace(/\r?\n/g, ' '); - text = text.replace(/\|/g, '\\|'); + text = text.replace(/\|/g, 'or'); return text; } diff --git a/src/compiler/docs/test/markdown-props.spec.ts b/src/compiler/docs/test/markdown-props.spec.ts index a91625c001f..f6c827941b5 100644 --- a/src/compiler/docs/test/markdown-props.spec.ts +++ b/src/compiler/docs/test/markdown-props.spec.ts @@ -32,8 +32,8 @@ describe('markdown props', () => { | Property | Attribute | Description | Type | Default | | -------- | --------- | -------------- | ------------------- | ------- | -| \`hello\` | \`hello\` | This is a prop | \`boolean \\| string\` | \`false\` | -| \`hello\` | -- | This is a prop | \`boolean \\| string\` | \`false\` | +| \`hello\` | \`hello\` | This is a prop | \`boolean or string\` | \`false\` | +| \`hello\` | -- | This is a prop | \`boolean or string\` | \`false\` | `); });