Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.6k views
in Q2A Core by
I am writing a new plugin thats a filter. I have most of it done except that when I modify the content, I want to add some HTML tags. When I take my content string and add the tags, the tags are rendered as text back to the user, they are not evaluated as HTML. How can I make the tags that I add via the filter render as HTML? I have tried adding them both as HTML and BBCode style (like [a] my link [/a]). What do I need to do to make sure that my filter plugin output is rendered out as HTML???

2 Answers

+1 vote
by
 
Best answer
I think I might have answered my own question while fooling around with the QA code. Because its a WYSIWYG editor, i had assumed that the entered text would be treated as HTML but it is NOT. So, within the filter code, you must ALSO set the content type to HTML. Otherwise, it will treat your content as text and output it accordingly. So it's a small change, but highly necessary in order to get embeded HTML tags to work right.
+1 vote
by
1st: Check qa_post table in you database. Your HTML/BBCode will be added in "content" field of qa_post table record.

2nd: When you display page, posted content is sanitized by get_html() in qa-viewer-basic.php.

I think ... to cope with this problem, it may be necessary to override and tune get_html() of qa-base.php.
by
Thanks for the insight but I think I might have answered my own question after fooling around a bit. I've provided it within this same thread.
by
You are welcome. I wish the core developer solves this problem in V1.7.
@D_M_S: Please ignore my wrong (hided) comment. My investigation was short.
...