Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

no viewer found for format: markdown

+2 votes
asked Mar 12, 2015 in Themes by Вук Станковић

I'm creating a theme and I've created question view, but instead of content i get 

[no viewer found for format: markdown]

Any idea why. I did no core hacking, just overriding theme-base.php

Also, when I look at console, I see this: 

Uncaught RangeError: Maximum call stack size exceeded

This error occurs here: 

            var qa_root = '..\/';
            var qa_request = '127272\/what-affect-do-ethanol-detergent-and-have-the-cell-membranes';
            var qa_oldonload = window.onload;
            window.onload = function() {
                if (typeof qa_oldonload == 'function')
                document.getElementById('anew').qa_focus=function() { document.getElementById('a_content').focus(); };
                document.getElementById('c127272').qa_focus=function() { document.getElementById('c127272_content').focus(); };


1 Answer

+2 votes
answered Mar 12, 2015 by pupi1985
selected Mar 12, 2015 by Вук Станковић
Best answer

The reason why you the "no viewer found for format" error is that you have installed the Markdown plugin. Then created some posts using that plugin. Then removed that plugin. So you now have posts in a format that Q2A on its own is not able to handle. This error appears when you try to display those posts.

The most appropriate solution would be to add the Markdown plugin again. You could also use some tool to turn markdown into HTML (maybe this one http://dillinger.io ?), edit each of the posts replacing the markdown with HTML and, finally, update all posts created with the markdown plugin turning them into HTML by means of the following SQL query:

UPDATE qa_posts SET format='html' WHERE format='markdown'

NOTE: You should backup all data before running SQL queries that modify data

commented Mar 12, 2015 by pupi1985
That's a separate issue unrelated to Q2A. I don't know what it could be as the cause seem to be custom code but smells like you are in an infinite loop that the browser cancels in order to recover from an excess of memory usage.
BTW, regarding the "almost no custom javascript at all", take into account that you can create an infinite loop with just this code: while (true) {}
commented Mar 12, 2015 by Вук Станковић
Fixed it. It was caused by calling a qa_html_theme_base::head_script();