검색결과 리스트
글
참고 : 다른 분것 참조를 했는데 링크를 읽어버렸습니다. ㅡㅡ;
위에 링크를 참조해서 span 태그의 whitepace 문제 수정
<script type="text/javascript">
<!--
;jQuery.noConflict(); // 다른 라이브러리와 충돌을 방지한다.
;(function($) { $(document).ready(function() {
//////////////////////////////////////////////////////////////////////////////////////
$("blockquote[class^=brush]").each( function() { //blokquote를 사용한 태그
var $this = $(this);
// 복사 붙여넣기 했을때 탭처리
$this.find("span[class*=Apple-tab-span]").replaceWith(function() {
return $(this).text();
});
// 편집창에서 직접 수정했을때 탭 처리
$this.find("p[style*=margin-left]").each(function() {
var $elem = $(this);
var style = $elem.attr("style");
var result = /\s*?margin-left:\s(\w+?)em;\s*?/gi.exec(style);
if ( result != null ) {
result = result[1];
}
var spaceCount = parseInt(result) * 2;
var spaceString = "";
for (var i = 0; i < spaceCount; i++) {
spaceString += " ";
}
$elem.removeAttr("style");
$elem.html(spaceString + $elem.html());
});
var temp = $this.html(); // 내용 복사
temp = temp.replace(/\n/gi, "");
temp = temp.replace(/<p><\/p>/gi, "");
temp = temp.replace(/<p><br\s*\/?><\/p>/gi, "\n"); // 줄바꿈
temp = temp.replace(/<P>(.*?)<\/P>/gi, "$1\n"); // 한줄끝
temp = temp.replace(/<br\s*\/?>/gi, "\n"); // 줄바꿈
temp = '<script type="syntaxhighlighter" class="' + $this.attr('class') + '"><![CDATA[' + temp + ']]><\/script>'
$this.replaceWith(temp);
});
$("pre[class^=brush]").each( function() { //pre를 사용한 태그
var $this = $(this);
var temp = $this.html(); // 내용 복사
temp = temp.replace(/</g, "<");
$this.html = temp;
});
/* SyntaxHighlighter 사용부분 */
SyntaxHighlighter.defaults['toolbar'] = false; // 툴바 안 보기
SyntaxHighlighter.all();
//////////////////////////////////////////////////////////////////////////////////////
});})(jQuery);
//-->
</script>
'일반' 카테고리의 다른 글
[Icon] 무료 아이콘 (0) | 2013.01.21 |
---|---|
폴더 삭제가 안되는 오류 '이 작업을 수행하기 위한 권한이 필요합니다' (1) | 2012.08.02 |
[컬럼] 객체지향을 넘어서 관점지향으로 AOP (0) | 2012.07.12 |
[Windows7] 내 자격 증명 기억을 해도 네트워크 드라이브 인증을 요구할때 (0) | 2012.06.29 |
[Ghost] 고스트를 이용해서 백업하자 (0) | 2012.04.26 |
RECENT COMMENT