1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-02-16 19:47:23 +02:00

Added markdown styles from mattermost-webapp (#1500)

* added markdown styles from mattermost-webapp

* removed semicolon to satisfy eslint demands

* Update _markdown.scss
This commit is contained in:
Jenya 2021-10-12 17:22:04 +00:00 committed by GitHub
parent d8a4d197ed
commit adfa8dd347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import '@mattermost/compass-icons/css/compass-icons.css'
import './styles/variables.scss'
import './styles/main.scss'
import './styles/labels.scss'
import './styles/_markdown.scss'
import store from './store'

View File

@ -0,0 +1,19 @@
.markdown__table {
margin: 5px 0 10px;
background: var(--center-channel-bg);
th,
td {
padding: 6px 13px;
border: 1px solid #ddd;
}
a {
white-space: nowrap;
word-break: initial;
}
tbody tr {
background: var(--center-channel-bg);
}
}

View File

@ -224,6 +224,11 @@ class Utils {
`onclick="event.stopPropagation();${((window as any).openInNewBrowser ? ' openInNewBrowser && openInNewBrowser(event.target.href);' : '')}"` +
'>' + contents + '</a>'
}
renderer.table = (header, body) => {
return `<div class="table-responsive"><table class="markdown__table"><thead>${header}</thead><tbody>${body}</tbody></table></div>`
}
const html = marked(text.replace(/</g, '&lt;'), {renderer, breaks: true})
return html.trim()
}