usemap을 이용합니다.

usemap을 이용합니다.

QA

usemap을 이용합니다.

본문

map 태그 설정 시  name값은 저장되는데, id값 저장이 안되네요

 

id값은 없어지고...</map> 정보는 생깁니다. 


<map name="aaa"> </map>

<area shape="rect" coords="740,713,396,78" href="%E2%80%8B"></map>

이 자꾸 생기네요

 

왜그럴까요??

 

 

 

img  태그에 usemap 저장을 위해서 

/lib/common.lib.php  일부 수정하였습니다. 

 

=================================================================

/lib/common.lib.php 

html_purifier 함수에 추가 

    $config->set('Attr.AllowedFrameTargets', array('_blank')); 
    //유튜브, 비메오 전체화면 가능하게 하기 
    $config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo())); 


==> 여기부터 추가 

    $def = $config->getHTMLDefinition(true); 

// Add usemap attribute to img tag 
    $def->addAttribute('img', 'usemap', 'CDATA'); 

// Add map tag 
    $map = $def->addElement( 
            'map', // name 
            'Block', // content set 
            'Flow', // allowed children 
            'Common', // attribute collection 
            array(// attributes 
        'name' => 'CDATA', 
        'id' => 'ID', 
        'title' => 'CDATA', 
            ) 
    ); 
    $map->excludes = array('map' => true); 

// Add area tag 
    $area = $def->addElement( 
            'area', // name 
            'Block', // content set 
            'Empty', // don't allow children 
            'Common', // attribute collection 
            array(// attributes 
        'name' => 'CDATA', 
        'id' => 'ID', 
        'alt' => 'Text', 
        'coords' => 'CDATA', 
        'accesskey' => 'Character', 
        'nohref' => new HTMLPurifier_AttrDef_Enum(array('nohref')), 
        'href' => 'URI', 
        'shape' => new HTMLPurifier_AttrDef_Enum(array('rect', 'circle', 'poly', 'default')), 
        'tabindex' => 'Number', 
        'target' => new HTMLPurifier_AttrDef_Enum(array('_blank', '_self', '_target', '_top')) 
            ) 
    ); 
    $area->excludes = array('area' => true); 


===> 여기까지 

    $purifier = new HTMLPurifier($config); 
    return $purifier->purify($html);

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 530
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT