강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

TOMS님의 프로필 이미지
TOMS

작성한 질문수

CKEditor 글 저장할 때 tags 질문입니다.

작성

·

748

0

import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
<CKEditor
                      editor={ ClassicEditor }
                      config={{
                        placeholder: "글을 입력하십시오."
                      }}
                      // data="<p>내용</p>"
                      onReady={ editor => {
                          // You can store the "editor" and use when it is needed.
                          // console.log( 'Editor is ready to use!', editor );
                      } }
                      onChange={ ( eventeditor ) => {
                          const data = editor.getData();
                          // console.log( { event, editor, data } );
                          this.setState({content: data})
                        }}
                      onBlur={ ( eventeditor ) => {
                          // console.log( 'Blur.', editor );
                      } }
                      onFocus={ ( eventeditor ) => {
                          // console.log( 'Focus.', editor );
                      } }
                  />
REACT로 에디터 구현 중입니다. 리액트에서 NODE JS로 정보를 전달하여 DB에 저장해서 정보를 불러오는데 <P>태그가 붙어서 태그
제거방법을 찾아봤습니다. 인터넷에 올라온 방법이 에디터 config.js에서 CKEDITOR.editorConfig = function(config){ config.enterMode = CKEDITOR.ENTER_BR}
을 넣으라고 하는데, 이것만 알려주고 어떻게 하는지 도통 이해할 수가 없어서 글 올려요. 혹시 다른 방법이 있거나 html
으로 출력하라는 것도 있는데 혹시 시간이 되신다면 알려주실 수 있을까요?

답변

답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!
TOMS님의 프로필 이미지
TOMS

작성한 질문수

질문하기