File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -952,6 +952,15 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html
952952
953953 self.manualRender = self.preferences .markdownManualRender ;
954954
955+ #if 0
956+ // Unfortunately this DOM-replacing causes a lot of problems...
957+ // 1. MathJax needs to be triggered.
958+ // 2. Prism rendering is lost.
959+ // 3. Potentially more.
960+ // Essentially all JavaScript needs to be run again after we replace
961+ // the DOM. I have no idea how many more problems there are, so we'll have
962+ // to back off from the path for now... :(
963+
955964 // If we're working on the same document, try not to reload.
956965 if (self.isPreviewReady && [self.currentBaseUrl isEqualTo:baseUrl])
957966 {
@@ -979,9 +988,11 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html
979988 // Replace everything in the old <html> tag.
980989 DOMElement *htmlNode = (DOMElement *)[htmlNodes item:0];
981990 htmlNode.innerHTML = html;
991+
982992 return;
983993 }
984994 }
995+ #endif
985996
986997 // Reload the page if there's not valid tree to work with.
987998 [self .preview.mainFrame loadHTMLString: html baseURL: baseUrl];
You can’t perform that action at this time.
0 commit comments