mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
add attributes to fence blocks
This commit is contained in:
@@ -738,10 +738,17 @@ export default class MarkdownPreview extends React.Component {
|
||||
try {
|
||||
const chartConfig = JSON.parse(el.innerHTML)
|
||||
el.innerHTML = ''
|
||||
var canvas = document.createElement('canvas')
|
||||
|
||||
const canvas = document.createElement('canvas')
|
||||
el.appendChild(canvas)
|
||||
/* eslint-disable no-new */
|
||||
new Chart(canvas, chartConfig)
|
||||
|
||||
const height = el.attributes.getNamedItem('data-height')
|
||||
if (height && height.value !== 'undefined') {
|
||||
el.style.height = height.value + 'vh'
|
||||
canvas.height = height.value + 'vh'
|
||||
}
|
||||
|
||||
const chart = new Chart(canvas, chartConfig)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
el.className = 'chart-error'
|
||||
|
||||
Reference in New Issue
Block a user