I try WMD. But... The completeness is low.
Perhaps my javascript code is wrong, only FF move definitely.
Step1)
download package <<
http://wmd-editor.com/download
"wmd" folder move under qa-content.
Step2)
Update qa-include/qa-app.format.php
(L258-264: replace to 1-line)
---
/*
if (isset($blockwordspreg))
$post['content']=qa_block_words_replace($post['content'], $blockwordspreg);
$fields['content']=qa_html($post['content'], true); // also used for rendering content when asking follow-on q
if ($showurllinks)
$fields['content']=qa_html_convert_urls($fields['content']);
*/
$fields['content']=$post['content'];
---
(L267: SPAN tag -> DIV tag)
---
//$fields['content']='<SPAN CLASS="entry-content">'.$fields['content'].'</SPAN>';
$fields['content']='<DIV CLASS="entry-content">'.$fields['content'].'</DIV>';
---
(L269: commnent out)
---
// $fields['content']='<A NAME="'.qa_html($postid).'"></A>'.$fields['content'];
---
Step3)
Update qa-include/qa-theme-base.php (Please warn the person customizing theme.)
(L167: add line to head_custom())
---
switch ($this->template) {
case 'ask':
case 'question':
$this->output('
<script type="text/javascript" src="qa-content/wmd/showdown.js"></script>
<script type="text/javascript">
window.onload=function(){
var converter = new Showdown.converter();
var tags=document.getElementsByTagName("DIV");
var tag;
for(var i=0;i<tags.length;i++){
tag = tags.item(i);
if(tag.className=="entry-content") {
tag.innerHTML = converter.makeHtml(tag.innerHTML);
}
}
}
</script>
');
break;
default:
NULL;
}
---
(L778: add line to form_text_multi_row())
---
switch ($this->template) {
case 'ask':
case 'question':
//if (preg_match('/qcontent/', $field['tags'])) $name='qcontent';
//if (preg_match('/acontent/', $field['tags'])) $name='acontent';
//if (preg_match('/comment/', $field['tags'])) $name='comment';
//if ($name!='comment') {
$this->output('<div class="wmd-preview"></div>');
$this->output('<script type="text/javascript" src="qa-content/wmd/wmd.js"></script>');
//}
break;
default:
NULL;
}
---
My environment test)
FF(V3.6) : move definitely
IE(V8) : CSS of bar is strange?
Opera(10.6) : Don't display bar...
Safari-win(V5) : Don't display bar...
Another problem)
It is sequrity-problem that we can input raw HTML. I seem not to be able to input it at StackOverflow.