smarteditor2 사용중이구요
글 내용안에 a name , div id , span id , p id 를 지정해도
실제 내용에서 제외되고 나오는데 해당 태그 허용되게 할려면 어떻게 해야하나요?
예)
<a name="aaa">aaa
를 해두면
실제 view에서는 <a>aaa 이렇게만 나옵니다.
|
답변 1개 / 댓글 2개
채택된 답변
+20 포인트
5년 전
HTMLPurifier 플러그인이 다듬는 건데요
https://github.com/gnuboard/gnuboard5/blob/master/lib/common.lib.php#L612
$config 옵션을 주면되긴 하는데...
prefix를 안붙이면
view 페이지의 id/input.name 등과 겹칠 수 있습니다
수정이야 prefix가 입력된 게 보이지만
등록할 땐 사용자가 prefix가 뭔지 모르니까
id/name 참조에 영향이 있겠네요
Copy
$config->set('Attr.EnableID', true);
$config->set('Attr.IDPrefix', 'user_');
$purifier = new HTMLPurifier($config);
답변에 대한 댓글 2개
5년 전
답변을 작성하려면 로그인이 필요합니다.
a 태그의 name attr은 html5에서 제거되었습니다
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
Attributes
name
Obsolete since HTML5
Was required to define a possible target location in a page. In HTML 4.01, id and name could both be used on <a>, as long as they had identical values.
Note
Use the global attribute id instead.
대신 id 를 사용할 것을 권하네요