게시글 본문 자동 줄 바꿈 기능 질문 채택완료

게시글 본문 자동 줄 바꿈은 어디서 이루어 지나요? 

만약 이거를 dhtml 에디처럼 br태그 대신에 한줄마다 p태그를 넣어 줄 수 있을까요?

 

제가 common.lib.php 에서 찾은게 있는대 이게 본문 자동 줄 바꿈 테그 인가요?

Copy
function conv_content($content, $html, $filter=true)
{
    global $config, $board;

    if ($html)
    {
        $source = array();
        $target = array();

        $source[] = "//";
        $target[] = "";

        if ($html == 2) { // 자동 줄바꿈
            $source[] = "/\n/";
            $target[] = "<br/>";
        }

        // 테이블 태그의 개수를 세어 테이블이 깨지지 않도록 한다.
        $table_begin_count = substr_count(strtolower($content), "<table");
        $table_end_count = substr_count(strtolower($content), "</table");
        for ($i=$table_end_count; $i<$table_begin_count; $i++)
        {
            $content .= "</table>";
        }

        $content = preg_replace($source, $target, $content);

        if($filter)
            $content = html_purifier($content);
    }
    else // text 이면
    {
        // & 처리 : &amp; &nbsp; 등의 코드를 정상 출력함
        $content = html_symbol($content);

        // 공백 처리
        //$content = preg_replace("/  /", "&nbsp; ", $content);
        $content = str_replace("  ", "&nbsp; ", $content);
        $content = str_replace("\n ", "\n&nbsp;", $content);

        $content = get_text($content, 1);
        $content = url_auto_link($content);
    }

    return $content;
}

답변 1개

common.lib.php 찾았습니다. 1486번째 줄부터 있더군요

Copy
if ($html) {
        $source[] = "\n";
        $target[] = "<p/>";
    }
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고