git-svn-id: http://xe-core.googlecode.com/svn/trunk@543 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-19 10:03:11 +00:00
parent 9e94a95c4a
commit d8a6852a72
4 changed files with 36 additions and 5 deletions

View file

@ -319,7 +319,7 @@
**/
function transContent($content) {
// 에디터 컴포넌트를 찾아서 결과 코드로 변환
$content = preg_replace_callback('!<(div|img) editor_component="([a-zA-Z\_^\"]+)"([^\>]*?)>!is', array($this,'_transMultimedia'), $content);
$content = preg_replace_callback('!<(div|img)([^\>]*?)>(<\/div>)?!is', array($this,'_transMultimedia'), $content);
// <br> 코드 변환
$content = str_replace(array("<BR>","<br>","<Br>"),"<br />", $content);
@ -335,9 +335,13 @@
* <img ... class="multimedia" ..> 되어 있는 코드를 변경
**/
function _transMultimedia($matches) {
// IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌
$buff = $matches[0];
$buff = preg_replace('/([^=^"^ ]*)=([^"])([^=^ ]*)/i', '$1="$2$3"', $buff);
// 플러그인에서 생성된 코드 (img, div태그내에 plugin코드 존재)의 parameter를 추출
$oXmlParser = new XmlParser();
$xml_doc = $oXmlParser->parse($matches[0]);
$xml_doc = $oXmlParser->parse($buff);
// plugin attribute가 없으면 return
$editor_component = $xml_doc->attrs->editor_component;