I provide this issue to discuss the rendering of messages. I propose to render messages individually and selectively, rather than the current way which puts the entire page with all messages into a big string and then calls renderStxIn(). The current ZWikiPage.preRender looks like:
t = text or (page.document()+'\n'+MIDSECTIONMARKER+ \ self.preRenderMessages(page)) t = page.applyWikiLinkLineEscapesIn(t) t = self.renderStxIn(page, t) if page.usingPurpleNumbers(): t = page.renderPurpleNumbersIn(t) t = page.markLinksIn(t)
Instead I propose that renderStxIn (and other functions) only be applied to the document, and preRenderMessage(s) handle calling renderStxIn (and others) for messages.
I propose this because
- STX puts <p>...</p> around everything, including the markup added by ZWiki such as makeCommentHeading, which is known to not be STX.
- Message citations are not strict STX, so unexpected structure causes unusual things to happen. We should only mark up the sections we know to be STX. (I have already seen problems on my wiki) The only reason my blockquote patch works is because I put extra
\n
in it so that the blockquote tag doesn't end up on the same line as some STX, which can cause formatting problems. But this causes extra <p>...</p> which is unecessary and renders differently in browsers (some put extra whitespace, some don't...). - Citations should not be considered the same piece of STX as the message quoting. They should be treated as separate documents. I did this first for mine with a renderStxLatexIn function, and it worked great, but I changed my patch to be more like the ZWiki code, and am seeing problems.
- Will this be horribly slow? (don't have to regex over larger document...but many more function calls)
- Will this enable us to remove Z-WIKI-MID-SECTION? Could a PageType? call ZWikiPage.renderMidSectionIn itself?
An example of STX failure is in the last message on my Test Page
-- Bob