반응형
티스토리 소스 이쁘게 보려고 했다...
여기 저기 뒤져 보다가 찾아서 하긴 했지만 스킨 바꾸니 또 안된다...
알고 보니 소스 날아가더라....젠장할....
그래서 기록용으로 처리 한다....
참고 할 사람은 잘 참고 하시길....
내용 중 $("#mArticle .area_view pre[mode]") 내부 Object를 찾아야 하니 필히 변경해야 한다.
변경 안하면 안됨
그 외에는 할게 없다.
mode는 종류가 많으니 잘 찾아서 사용하면 되고, xml은 < > 꺽쇠가 있으니 꺽쇠를 일반 텍스트에 입력 후 html로 변환하면 코드로 변환된다.
그리고 해당 코드를 pre로 변경하면 잘 적용된다.
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/theme-monokai.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/mode-xml.js"></script> <script> $("#mArticle .area_view pre[mode]").each(function() { try{ var lang = $(this).attr("mode"); var editor = ace.edit(this); editor.setOptions({ maxLines: Infinity }); editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/"+ lang); editor.setShowInvisibles(true); editor.setReadOnly(true); editor.setShowPrintMargin(false); editor.session.setUseWrapMode(true); } catch(ex) { console.info (ex) } }) document.getElementById('editor').style.fontSize='10px'; </script>
'잡담' 카테고리의 다른 글
Window 11 우 클릭 예전으로 (0) | 2024.07.17 |
---|---|
Visual Studio Code 동기화 (0) | 2020.01.02 |
윈도우 7 이상 사용자 패스워드 변경방법 (0) | 2019.01.25 |
Sql Server 2012 CPU Full.... (0) | 2018.04.03 |