mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-02-04 07:13:25 +08:00
Inline svg font
This commit is contained in:
parent
fe0434cb16
commit
a4348f1963
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "7.0.17",
|
"version": "7.0.18",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid.core.js",
|
"main": "dist/mermaid.core.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -437,7 +437,14 @@ var render = function (id, txt, cb, container) {
|
|||||||
// insert inline style into svg
|
// insert inline style into svg
|
||||||
const svg = element.firstChild
|
const svg = element.firstChild
|
||||||
const s = document.createElement('style')
|
const s = document.createElement('style')
|
||||||
s.innerHTML = themes[config.theme] || defaultTheme
|
const cs = window.getComputedStyle(svg)
|
||||||
|
s.innerHTML = `
|
||||||
|
${themes[config.theme] || defaultTheme}
|
||||||
|
svg {
|
||||||
|
color: ${cs.color};
|
||||||
|
font: ${cs.font};
|
||||||
|
}
|
||||||
|
`
|
||||||
svg.insertBefore(s, svg.firstChild)
|
svg.insertBefore(s, svg.firstChild)
|
||||||
|
|
||||||
d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml')
|
d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user