Skip to content

Commit

Permalink
Disable the new rendering strategy
Browse files Browse the repository at this point in the history
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.
uranusjr committed Nov 6, 2016

Verified

This commit was signed with the committer’s verified signature.
ggwpez Oliver Tale-Yazdi
1 parent 7eadd3f commit d105ea6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions MacDown/Code/Document/MPDocument.m
Original file line number Diff line number Diff line change
@@ -952,6 +952,15 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html

self.manualRender = self.preferences.markdownManualRender;

#if 0
// Unfortunately this DOM-replacing causes a lot of problems...
// 1. MathJax needs to be triggered.
// 2. Prism rendering is lost.
// 3. Potentially more.
// Essentially all JavaScript needs to be run again after we replace
// the DOM. I have no idea how many more problems there are, so we'll have
// to back off from the path for now... :(

// If we're working on the same document, try not to reload.
if (self.isPreviewReady && [self.currentBaseUrl isEqualTo:baseUrl])
{
@@ -979,9 +988,11 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html
// Replace everything in the old <html> tag.
DOMElement *htmlNode = (DOMElement *)[htmlNodes item:0];
htmlNode.innerHTML = html;

return;
}
}
#endif

// Reload the page if there's not valid tree to work with.
[self.preview.mainFrame loadHTMLString:html baseURL:baseUrl];

0 comments on commit d105ea6

Please sign in to comment.