Răsfoiți Sursa

add markdown to Page states

utsushiiro 7 ani în urmă
părinte
comite
73a8244f3c
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/client/js/components/Page.js

+ 2 - 2
src/client/js/components/Page.js

@@ -11,6 +11,7 @@ export default class Page extends React.Component {
 
 
     this.state = {
     this.state = {
       html: '',
       html: '',
+      markdown: ''
     };
     };
 
 
     this.appendEditSectionButtons = this.appendEditSectionButtons.bind(this);
     this.appendEditSectionButtons = this.appendEditSectionButtons.bind(this);
@@ -31,7 +32,6 @@ export default class Page extends React.Component {
   }
   }
 
 
   setMarkdown(markdown) {
   setMarkdown(markdown) {
-    this.setState({ markdown });
     this.renderHtml(markdown, this.props.highlightKeywords);
     this.renderHtml(markdown, this.props.highlightKeywords);
   }
   }
 
 
@@ -105,7 +105,7 @@ export default class Page extends React.Component {
       .then(() => interceptorManager.process('postPostProcess', context))
       .then(() => interceptorManager.process('postPostProcess', context))
       .then(() => interceptorManager.process('preRenderHtml', context))
       .then(() => interceptorManager.process('preRenderHtml', context))
       .then(() => {
       .then(() => {
-        this.setState({ html: context.parsedHTML });
+        this.setState({ html: context.parsedHTML, markdown });
       })
       })
       // process interceptors for post rendering
       // process interceptors for post rendering
       .then(() => interceptorManager.process('postRenderHtml', context));
       .then(() => interceptorManager.process('postRenderHtml', context));