diff options
Diffstat (limited to 'spring-front/src/components/Editor.js')
-rw-r--r-- | spring-front/src/components/Editor.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spring-front/src/components/Editor.js b/spring-front/src/components/Editor.js index d062e28..7b97a50 100644 --- a/spring-front/src/components/Editor.js +++ b/spring-front/src/components/Editor.js @@ -155,6 +155,14 @@ export default class Editor extends React.Component { } res = response.json().then((json) => { this.setState({ value: json.body }); + let result_element = document.getElementById("highlight-content"); + result_element.textContent = this.state.value; + document.querySelectorAll("pre code").forEach((block) => { + hljs.highlightElement(block); + }); + let element = document.getElementById("markdown-placeholder"); + let htm = md.render(this.state.value); + element.innerHTML = htm; }); } ); |