PC 게시판에서 밴드 공유하기로 글 등록할 때 줄바꿈이 안되네요.

혹시 게시글 그대로 줄바꿈이 되도록 소스코드를 어떻게 수정해야 될까요??

 

아래는 소스코드 입니다. 빨간색 글씨가 밴드 부분 입니다.

 

<?php
if(!defined("__XE__")) exit();
 
if(Context::getResponseMethod() == "XMLRPC" || Context::get('module') == "admin") return;
if($called_position != "before_display_content") return;
 
if($called_position == 'before_display_content' && Context::getResponseMethod() == 'HTML') {
    $pos_regx = "!<\!--AfterDocument\(([0-9]+),([0-9]+)\)-->!is";
        $document_srl = intval(Context::get('document_srl'));
        $oDocumentModel = &getModel('document');
 
        $oDocument = $oDocumentModel->getDocument(Context::get('document_srl'), false, false);
        if (!$oDocument) return;
 
        $appid = $addon_info->appid;
        if (!$appid) $appid = 'm.kakao.com';
        $appver = $addon_info->appver;
        if (!$appver) $appver = '2.0';
        $apiver = $addon_info->apiver;
        if (!$apiver) $apiver = '1.0';
        $appname = $addon_info->appname;
        if (!$appname) $appname = 'Community Website]';
        $button_align = $addon_info->button_align;
        $button_width = $addon_info->button_width;
        if (!$button_width) $button_width = '81';

      

       //밴드 보내기를 위한 알고리즘
        $band_sand_title = $oDocument->getTitleText(); //제목
        $mypeople_link=$band_sand_url = $oDocument->getPermanentUrl(); //링크주소
        $mypeople_prefix=$band_sand_msg = $oDocument->getSummary('%0D%0A');  //글내용
        $mypeople_prefix1=$band_sand = rawurlencode("제목 : ".$band_sand_title).urlencode("\n\n").rawurlencode($band_sand_msg).urlencode("\n[출처:").$appname;

        //모바일인지 체크
        $mobile_agent = '/(iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS)/';
        if(preg_match($mobile_agent, $_SERVER['HTTP_USER_AGENT'])){
            $before = '<div style="text-align: '.$button_align.';">
   
   <a href="kakaolink://sendurl?msg='.$band_sand.'&appid='.$appid.'&apiver='.$apiver.'&appver='.$appver.'&appname='.$appname.'" >
   <img src="/addons/msn/img/kakaotalkicon.png" border="0" width="'.$button_width.'" alt="카카오톡 모바일용"></a>
  
   <a href="storylink://posting?post='.$oDocument->getTitleText().'%0A%0A'.rawurlencode($band_sand_msg).urlencode("\n\n더보기=>").$oDocument->getPermanentUrl().'&appid='.$appid.'&apiver='.$apiver.'&appver='.$appver.'&appname='.$appname.'&urlinfo='.$result.'" ><img src="/addons/msn/img/kakaostoryicon.png" width="'.$button_width.'" /></a>

   <a href="bandapp://create/post?text='.$band_sand.'" >
   <img src="/addons/msn/img/bandicon.png" width="'.$button_width.'" /></a>

   <a href="https://m.mypeople.daum.net/mypeople/mweb/share.do?link='.$mypeople_link.'&prefix='.$mypeople_prefix.'&source_id=none" >
            <img src="/addons/msn/img/mypeople.png" border="0" width="'.$button_width.'" alt="마이피플 모바일용"></a>
   
   <a href="https://m.facebook.com/sharer.php?u='.$mypeople_link.'&ko='.$mypeople_prefix.'&source_id=none">
            <img src="/addons/msn/img/facebook.png" border="0" width="'.$button_width.'" alt="페이스북 모바일용"></a>
   
   <a href="https://twitter.com/share?text='.$mypeople_prefix.'&url='.$mypeople_link.'&source_id=none">
            <img src="/addons/msn/img/twitter.png" border="0" width="'.$button_width.'" alt="트위터 모바일용"></a>

   <a href="http://plus.google.com/share?url='.$mypeople_link.'?l=ko='.$mypeople_prefix.'&source_id=none">
            <img src="/addons/msn/img/google.png" border="0" width="'.$button_width.'" alt="구글플러스 모바일용"></a>

   <a  href="line://msg/text/'.$mypeople_prefix.'%0D%0A'.$mypeople_link.'&source_id=none">
   <img src="/addons/msn/img/line.png" border="0" width="'.$button_width.'" alt="라인 모바일용"></a>

   </a>';
            $output = preg_replace($pos_regx, "<!--AfterDocument($1,$2)-->".$before, $output);
            }else{
            $before = '<div style="text-align: '.$button_align.';">

      <a href="http://www.band.us/plugin/share?body='.$band_sand.'&ko&referrer='.$mypeople_prefix1.'" target="_blank">
      <img src="/addons/msn/img/bandicon2.png" title= "밴드에 공유하기!"width="'.$button_width.'" />

            
   </a>';
            $output = preg_replace($pos_regx, "<!--AfterDocument($1,$2)-->".$before, $output);
            }
}
?>