Skip to content

Commit d105ea6

Browse files
committed
Disable the new rendering strategy
This has proven to be problematic because we lost many JavaScript hooks. Will need to think how we can test this more rigorously. Fix #693 for now.
1 parent 7eadd3f commit d105ea6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

MacDown/Code/Document/MPDocument.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)