From 874ea6c0a248c218877a45e757e15b2b880fb05b Mon Sep 17 00:00:00 2001 From: teidesu Date: Thu, 15 Apr 2021 09:50:07 +0300 Subject: [PATCH] fix(tl-ref): layout and content preprocessing fixes --- packages/tl-reference/scripts/prepare-data.js | 4 ++-- packages/tl-reference/src/global.scss | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/tl-reference/scripts/prepare-data.js b/packages/tl-reference/scripts/prepare-data.js index 3bc0a5fc..11589cfc 100644 --- a/packages/tl-reference/scripts/prepare-data.js +++ b/packages/tl-reference/scripts/prepare-data.js @@ -42,7 +42,7 @@ const camelToSnake = (str) => const camelToPascal = (s) => s[0].toUpperCase() + s.substr(1) function renderDescription(description) { - return marked.parseInline( + return marked( description.replace(/{@link (.+?)}/g, (_, name) => { if (name.startsWith('tl.')) { let [ns, type] = name.substr(3).split('.') @@ -75,7 +75,7 @@ function renderDescription(description) { } return `\`${name}\`` }) - ) + ).replace(/<(\/)?p>/g, '<$1div>') // replace

with

} function prepareData(data) { diff --git a/packages/tl-reference/src/global.scss b/packages/tl-reference/src/global.scss index 57c2b101..52732c47 100644 --- a/packages/tl-reference/src/global.scss +++ b/packages/tl-reference/src/global.scss @@ -35,14 +35,17 @@ h2, h3, h4 { word-break: break-all; } -table { - overflow-x: auto; - display: block!important; - white-space: nowrap; -} - -table tbody { - display: table; - width: 100%; +// table scroll for mobiles +@media screen and (max-width: 640px) { + table { + overflow-x: auto; + display: block !important; + white-space: nowrap; + } + + table tbody { + display: table; + width: 100%; + } }