fix(tl-ref): layout and content preprocessing fixes

This commit is contained in:
teidesu 2021-04-15 09:50:07 +03:00
parent ad511546ca
commit 874ea6c0a2
2 changed files with 14 additions and 11 deletions

View file

@ -42,7 +42,7 @@ const camelToSnake = (str) =>
const camelToPascal = (s) => s[0].toUpperCase() + s.substr(1) const camelToPascal = (s) => s[0].toUpperCase() + s.substr(1)
function renderDescription(description) { function renderDescription(description) {
return marked.parseInline( return marked(
description.replace(/{@link (.+?)}/g, (_, name) => { description.replace(/{@link (.+?)}/g, (_, name) => {
if (name.startsWith('tl.')) { if (name.startsWith('tl.')) {
let [ns, type] = name.substr(3).split('.') let [ns, type] = name.substr(3).split('.')
@ -75,7 +75,7 @@ function renderDescription(description) {
} }
return `\`${name}\`` return `\`${name}\``
}) })
) ).replace(/<(\/)?p>/g, '<$1div>') // replace <p> with <div>
} }
function prepareData(data) { function prepareData(data) {

View file

@ -35,14 +35,17 @@ h2, h3, h4 {
word-break: break-all; word-break: break-all;
} }
table { // table scroll for mobiles
overflow-x: auto; @media screen and (max-width: 640px) {
display: block!important; table {
white-space: nowrap; overflow-x: auto;
} display: block !important;
white-space: nowrap;
table tbody { }
display: table;
width: 100%; table tbody {
display: table;
width: 100%;
}
} }