공지사항 내용 수정
This commit is contained in:
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -29,6 +30,11 @@ class GetNoticeDao implements GetNoticePortOut {
|
||||
@Transactional
|
||||
public Optional<GetNotice> operate(GetNoticeCmd command) {
|
||||
GetNotice secArticle = mapper.getNotice(command);
|
||||
if (secArticle.getContent() != null) {
|
||||
String cleanedContent = HtmlUtils.htmlUnescape(secArticle.getContent());
|
||||
cleanedContent = cleanedContent.replaceAll("<p>\\s*</p>", "</br>");
|
||||
secArticle.setContent(cleanedContent);
|
||||
}
|
||||
|
||||
List<GetNoticeUploadFile> setArticleUploadFile =
|
||||
mapper.getUploadFiles(command.getId());
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="detail-content">
|
||||
<p th:utext="${notice.content}"></p>
|
||||
<p th:utext="${ notice.content }"></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user