$html = "";
// if previous iteration was diferent section or is first iteration and new section is not empty add h2
- if (($currentIndex != 0 && $data[$currentIndex - 1]['section'] != $section) || ($currentIndex == 0 && !empty($section))) {
+ if (($currentIndex != 0 && $this->str_val_or_empty($data[$currentIndex - 1], 'section') != $section) || ($currentIndex == 0 && !empty($section))) {
$html .= '<h2';
// if text is empty add class, title and url
$filtered_classes = $this->filter_meta_classes($class);
switch ($class) {
case in_array("list", $class):
// if previous iteration was diferent section close li
- if ($i != 0 && $data[$i - 1]['section'] != $section) {
+ if ($i != 0 && $this->str_val_or_empty($data[$i - 1], 'section') != $section) {
[$closing_tag, $is_list_closed] = $this->open_or_close_ul($is_list_closed, $class, CLOSE, $text);
$html .= $closing_tag;
}
default:
// if previous iteration was diferent section close p
- if ($i != 0 && $data[$i - 1]['section'] != $section) {
+ if ($i != 0 && $this->str_val_or_empty($data[$i - 1], 'section') != $section) {
[$closing_tag, $is_p_closed] = $this->open_or_close_p($is_p_closed, $class, CLOSE);
$html .= $closing_tag;