스마트에디터 왜 이러는 걸까요? ㅡㅡ;;

스마트에디터 왜 이러는 걸까요? ㅡㅡ;;

QA

스마트에디터 왜 이러는 걸까요? ㅡㅡ;;

본문


package main
import ("fmt")
func main() {
  var langs = [3]string{"HTML", "CSS", "JS"}
  fmt.Print(langs) // [HTML CSS JS]
}


위 코드를 적고 소스보기 해보니, 체에디터와 다르게 한줄로 보이더라구요. ㅡㅡ;;

[체에디터 경우]
<p>package main</p>
<p>import ("fmt")</p>
<p><br></p>
<p>func main() {</p>
<p>  var langs = [3]string{"HTML", "CSS", "JS"}</p>
<p>  fmt.Print(langs) // [HTML CSS JS]</p>
<p>}</p>

[스마트에디터 경우]
<p>package main</p><p>import ("fmt")</p><p><br></p><p>func main() {</p><p>  var langs = [3]string{"HTML", "CSS", "JS"}</p><p>  fmt.Print(langs) // [HTML CSS JS]</p><p>}</p>


스마트에디터도 체에디터처럼 p태그 단위로 줄바꿈해서 보이게 하려면 어떻게 해야 할까요?

이 질문에 댓글 쓰기 :

답변 1

https://github.com/gnuboard/gnuboard5/blob/master/plugin/editor/smarteditor2/config.js#L11

에 기재된 파일이

 

https://github.com/gnuboard/gnuboard5/blob/master/plugin/editor/smarteditor2/SmartEditor2Skin.html

인 경우

 

https://github.com/gnuboard/gnuboard5/blob/master/plugin/editor/smarteditor2/SmartEditor2Skin.html#L16

의 내용중 일부를 수정하며 확인할수 있도록 다음과 같이 수정후

smarteditor2.min.js > smarteditor2.js


...
<!-- <script type="text/javascript" src="./js/smarteditor2.min.js" charset="utf-8"></script> -->
<script type="text/javascript" src="./js/smarteditor2.js" charset="utf-8"></script>
...

 

https://github.com/gnuboard/gnuboard5/blob/master/plugin/editor/smarteditor2/js/smarteditor2.js#L5960

의 내용을 다음과 같이 업데이트 하는 방법이 있습니다.


...
    },
    
    $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus) {
        if (sMode == this.sMode) { this.setIR(this.getIR().replace(/<\/p>([^\n])/g, '</p>\n$1')); }
        if (sMode == this.sMode && !bNoFocus) { 
...
답변을 작성하시기 전에 로그인 해주세요.
전체 204
QA 내용 검색

회원로그인

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