답변 2개
채택된 답변
+20 포인트
11개월 전
※ 우선 사용하시는 템프릿과 보드의 skin에 따른 구분 된 위치에서~
- read.post.html의 코드를 수정하여 보시겠어요.
/templates/(basic, bootstrap)/board/(basic, gallery)/read_post.html, 이 파일에서
id="article_contents" 섹션을 찾아 이 부분을 아래와 같이 수정합니다
</p>
<p><div id="article_contents" class="{{ request.state.editor }}">
{{ write.wr_content | replace("\n", "
") | safe }}
</div></p>
<p>
comment.wr_content에 대해 같은 필터를 적용하여 줄바꿈을 유지할 수 있습니다.
</p>
<p><div class="contents">
{% if comment.is_secret %}
<i class="fa fa-lock"></i>
<span class="blind">비밀댓글입니다.</span>
{% endif %}
{% if comment.is_secret_content %}
<a href="{{ url_for('password_page', action='comment-view', bo_table=board.bo_table, wr_id=comment.wr_id) }}" class="certify">
댓글내용 확인
</a>
{% else %}
{{ comment.wr_content | replace("\n", "
") | safe }}
{% endif %}</p>
<p>
<div class="contents">, 이 섹션에서
</p>
<p> {{ comment.wr_content|safe }}</p>
<p>
</p>
<p> {{ comment.wr_content | replace("\n", "
") | safe }}</p>
<p>
♠ 이렇게 코드 수정을 하시면,
> 텍스트가 HTML로 렌더링될 때 줄바꿈(\n)이 HTML에서 무시되지 않을 겁니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
d
dos6
11개월 전
g
glitter0gim
11개월 전
~/_
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
감사합니다.