From 44593d546bd32f61eb5387f324485a20f9583c42 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 3 Jun 2022 22:48:34 +0430 Subject: load,delete and save are working now. we just need to add put. --- spring-front/src/components/Editor.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spring-front') 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; }); } ); -- cgit v1.2.3