테스트 사이트 - 개발 중인 베타 버전입니다

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

길가던분 4년 전 조회 6,227

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

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

 

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

</p>

<p>function conv_content($content, $html, $filter=true)

{

    global $config, $board;</p>

<p>    if ($html)

    {

        $source = array();

        $target = array();</p>

<p>        $source[] = "//";

        $target[] = "";</p>

<p>        if ($html == 2) { // 자동 줄바꿈

            $source[] = "/\n/";

            $target[] = "
";

        }</p>

<p>        // 테이블 태그의 개수를 세어 테이블이 깨지지 않도록 한다.

        $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>";

        }</p>

<p>        $content = preg_replace($source, $target, $content);</p>

<p>        if($filter)

            $content = html_purifier($content);

    }

    else // text 이면

    {

        // & 처리 : &amp;   등의 코드를 정상 출력함

        $content = html_symbol($content);</p>

<p>        // 공백 처리

        //$content = preg_replace("/  /", "  ", $content);

        $content = str_replace("  ", "  ", $content);

        $content = str_replace("\n ", "\n ", $content);</p>

<p>        $content = get_text($content, 1);

        $content = url_auto_link($content);

    }</p>

<p>    return $content;

}</p>

<p>

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

답변 1개

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

</p>

<p>    if ($html) {

        $source[] = "\n";

        $target[] = "<p/>";

    }</p>

<p>

로그인 후 평가할 수 있습니다

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

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

로그인