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)
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 <p> with <div>
}
function prepareData(data) {

View file

@ -35,6 +35,8 @@ h2, h3, h4 {
word-break: break-all;
}
// table scroll for mobiles
@media screen and (max-width: 640px) {
table {
overflow-x: auto;
display: block !important;
@ -45,4 +47,5 @@ table tbody {
display: table;
width: 100%;
}
}