Open bendavis78 opened 3 years ago
After some investigation, I found the following issues:
askbot.middleware.spaceless.SpacelessMiddleware
, which strips all whitespace from the response. This is really not needed, and is destructive, as whitespace sometimes contains valuable information. The source even has a #FIXME: why do we even have this?
comment next to it. Removing this fixed the issue of newlines being stripped (you also have to modify askbot/startup_procedures.py
to avoid the startup error).<script type="text/javascript">
lanai.highlightSyntax = function(){/* noop */};
</script>
I wasn't able to find an easy solution to server-side rendering, but was able to implement it in my own fork: https://github.com/BoldIdeaInc/askbot-devel/commit/04e64226016ef6dc719bc215525ba369c2668cb6
(note: this completely replaces client-side rendering, not sure what other side effects it may have)
I don't plan on submitting a PR for that change, as I think it involves more of a design discussion.
I want the following markdown code to work:
When writing the question with the above markdown, it does not show the preview correctly:
When I submit the question, it does render correctly on the first load:
However, when I refresh the page, the code loses newlines (and the syntax colors are oddly different):