php - Getting extra <b> tag in output -
i using codeigniter v 3.x
now make function load viewes templates
function load_guest($view,$data=array('data'=>''),$headerdata=array('data'=>''),$pagetitle='',$pagekeywords='',$pagedescription=''){ $ci = & get_instance(); //get instance, access ci superobject $headerdata['title']=$pagetitle; $headerdata['keyword']=$pagekeywords; $headerdata['description']=$pagedescription; $ci->load->view('partial/head',$headerdata); //here getting opening <b> tag on html output $ci->load->view($view,$data); //here getting closing </b> tag on html output $ci->load->view('partial/foot'); }
but when see html source after loading page on browser. see pair of <b></b>
tag source.
i checked whole project , search <b>
tag , sure not using <b>
tag anywhere.
i use phpstorm find in path <b>
tag , nothing found...
edit using hook also
function compress() { ini_set("pcre.recursion_limit", "16777"); $ci =& get_instance(); $buffer = $ci->output->get_output(); $re = '%# collapse whitespace everywhere in blacklisted elements. (?> # match whitespans other single space. [^\s ]\s* # either 1 [\t\r\n\f\v] , 0 or more ws, | \s{2,} # or 2 or more consecutive-any-whitespace. ) # note: remaining regex consumes no text @ all... (?= # ensure not in blacklist tag. [^<]*+ # either 0 or more non-"<" {normal*} (?: # begin {(special normal*)*} construct < # or < starting non-blacklist tag. (?!/?(?:textarea|pre|script)\b) [^<]*+ # more non-"<" {normal*} )*+ # finish "unrolling-the-loop" (?: # begin alternation group. < # either blacklist start tag. (?>textarea|pre|script)\b | \z # or end of file. ) # end alternation group. ) # if made here, not in blacklist tag. %six'; $new_buffer = preg_replace($re, " ", $buffer); // going check if processing has working if ($new_buffer === null) { $new_buffer = $buffer; } $ci->output->set_output($new_buffer); $ci->output->_display(); }
i able solve problem using lazy trick.
in hook compress() function replace <br>
tag manually.
$new_buffer = str_replace("<b>","",$new_buffer); $new_buffer = str_replace("</b>","",$new_buffer); $new_buffer = str_replace("</ b>","",$new_buffer);
this partially solves problem. still want know, there better solution this?
Comments
Post a Comment