Remove Empty
and Tags
<?php
$job_post = mysqli_real_escape_string($connection, trim($job_post));
$job_post = str_replace(' ', ' ', $job_post);
?>
/* REMOVE WHITE SPACE AND LINE BREAKS FROM JOB POSTS
------------------------------------------------------------------------------*/
function removeLineBreaks(){
$('p').each(function() {
var $this = $(this);
if($this.html().replace(/\s| /g, '').length == 0)
$this.remove();
});
$('span').each(function() {
var $this = $(this);
if($this.html().replace(/\s| /g, '').length == 0)
$this.remove();
});
}
var page_name = window.location.pathname; // get page name
if(page_name == '/job-description/' || page_name == 'job-description'){
removeLineBreaks(); // call function
}