Use theme properly and another syntax highlight change

This commit is contained in:
Yash-Singh1 2021-11-01 19:33:01 -07:00
parent d2b7a3ec28
commit ab3e076c91
2 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ When including attributes on ER diagrams, you must decide whether to include for
Mermaid syntax for ER diagrams is compatible with PlantUML, with an extension to label the relationship. Each statement consists of the following parts:
```markdown
```
<first-entity> [<relationship> <second-entity> : <relationship-label>]
```
@ -88,7 +88,7 @@ Where:
For example:
```markdown
```
PROPERTY ||--|{ ROOM : contains
```

View File

@ -46,8 +46,9 @@
function colorizeEverything(html) {
initEditor(monaco)
return new Promise((resolve, reject) => {
monaco.editor.setTheme('mermaid')
var parsed = parser.parseFromString(html, 'text/html').body
Promise.all([...parsed.querySelectorAll('pre[id*="code"]')].map(codeBlock => monaco.editor.colorize(codeBlock.innerText, 'mermaid', { theme: 'mermaid' }))).then(result => {
Promise.all([...parsed.querySelectorAll('pre[id*="code"]')].map(codeBlock => monaco.editor.colorize(codeBlock.innerText, 'mermaid'))).then(result => {
parsed.querySelectorAll('pre[id*="code"]').forEach((codeBlock, index) => codeBlock.innerHTML = result[index])
resolve(parsed.innerHTML)
})