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:
parent
d8a4d197ed
commit
adfa8dd347
@ -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'
|
||||
|
||||
|
19
webapp/src/styles/_markdown.scss
Normal file
19
webapp/src/styles/_markdown.scss
Normal 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);
|
||||
}
|
||||
}
|
@ -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, '<'), {renderer, breaks: true})
|
||||
return html.trim()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user