smarteditor2 HTML 소스 자동변환 문제
본문
<div style="overflow:auto; width:300px; height:150px;">
이런 태그를 입력했는데.... 출력될때는...
<div style="width:300px;height:150px;">
이렇게 변환되어 나오네요.
어디서 "overflow:auto;" 이부분을 삭제하는것 같은데요.
아시는분 조언 부탁드립니다.
감사합니다.
답변 2
lib/common.lib.php 파일
함수 function html_purifier($html) {}에 한줄 추가해주심 될거 같네요.
$config->set('CSS.AllowTricky', true); // <== 추가된부분.
function html_purifier($html)
{
$f = file(G5_PLUGIN_PATH.'/htmlpurifier/safeiframe.txt');
$domains = array();
foreach($f as $domain){
// 첫행이 # 이면 주석 처리
if (!preg_match("/^#/", $domain)) {
$domain = trim($domain);
if ($domain)
array_push($domains, $domain);
}
}
// 내 도메인도 추가
array_push($domains, $_SERVER['HTTP_HOST'].'/');
$safeiframe = implode('|', $domains);
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
$config = HTMLPurifier_Config::createDefault();
// data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다.
$config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache');
$config->set('CSS.AllowTricky', true); // <==추가된 부분
$config->set('HTML.SafeEmbed', false);
$config->set('HTML.SafeObject', false);
$config->set('Output.FlashCompat', false);
$config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
$config->set('Attr.AllowedFrameTargets', array('_blank'));
$purifier = new HTMLPurifier($config);
return $purifier->purify($html);
}!-->
입력한 html 소스를 지맘대로 바꿔버리는 것은 스마트에디터 뿐만이 아니어서...
답변을 작성하시기 전에 로그인 해주세요.