Summernote 에디터를 이용해 저장하고 조회하니 HTML 태그까지 같이 출력되었다.
Thymeleaf를 사용했기 때문에 th:utext를 이용하는 것으로 해결했다.
<span class="card-body text-dark" th:utext="${post.content}"></span>
th:utext는 unescaped text다.
참고 👇
[22/03/06] SpringBoot 타임리프 썸머노트(summernote) 저장과 조회
게시판 글 작성란이 조금 밋밋한 것 같아서 summer note를 추가해보았다. 사용 방법은 정말 간단했다.
velog.io
https://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html
Tutorial: Using Thymeleaf
1 Introducing Thymeleaf 1.1 What is Thymeleaf? Thymeleaf is a Java library. It is an XML/XHTML/HTML5 template engine able to apply a set of transformations to template files in order to display data and/or text produced by your applications. It is better s
www.thymeleaf.org
반응형
'FE > html' 카테고리의 다른 글
[Error] naver login Uncaught TypeError: Cannot read properties of undefined (reading 'age') (0) | 2022.10.03 |
---|---|
JavaScript에서 model 값 가져오기 (0) | 2022.08.13 |
form 외부에서 submit 버튼 (0) | 2022.08.04 |
Uncaught TypeError: $.ajax is not a function (0) | 2022.08.04 |
Uncaught TypeError: $(...).summernote is not a function (0) | 2022.08.03 |