Commit dbd03929 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Let tinymce insert <p> tags rather than <br> in text boxes; hack twitter...


Let tinymce insert <p> tags rather than <br> in text boxes; hack twitter filter do deal with stray <p>s inserted by tinymce
Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 88f56114
......@@ -7,9 +7,9 @@ class HTMLPurifier_Filter_Twitter extends HTMLPurifier_Filter
public function preFilter($html, $config, $context) {
$pre_regex = array(
'#<div id="twitter_div">\s*<h2 class="sidebar-title">([^<]*)</h2>\s*<ul id="twitter_update_list">\s*</ul>\s*</div>\s*'.
'#<div id="twitter_div">\s*<h2 class="sidebar-title">([^<]*)</h2>\s*<ul id="twitter_update_list">\s*</ul>\s*</div>\s*(?:<p>)?\s*'.
'<script\b[^>]+?\bsrc="http://twitter.com/javascripts/blogger.js"[^>]*></script>\s*'.
'<script\b[^>]+?\bsrc="http://twitter.com/statuses/user_timeline/([a-zA-Z0-9_]+).json\?callback=twitterCallback2&(?:amp;)?count=(\d+)"[^>]*></script>#s',
'<script\b[^>]+?\bsrc="http://twitter.com/statuses/user_timeline/([a-zA-Z0-9_]+).json\?callback=twitterCallback2&(?:amp;)?count=(\d+)"[^>]*></script>(?:</p>)?#s',
'#<embed\s+src="http://twitter.com/flash/twitter_badge.swf"[^>]+?\bflashvars="([^"]+)"[^>]*>\s*(</embed>)?#s',
'#<embed\s+src="http://static.twitter.com/flash/twitter_timeline_badge.swf"[^>]+?\bflashvars="([^"]+)"[^>]*>\s*</embed>#s',
);
......
......@@ -186,9 +186,6 @@ tinyMCE.init({
language: '{$language}',
directionality: "{$tinymce_langdir}",
content_css : {$content_css},
forced_root_block : "",
force_p_newlines : false,
apply_source_formatting: false,
//document_base_url: {$jswwwroot},
relative_urls: false
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment