getHelperPluginManager(); $partial = $plugins->get('partial'); // Fix html purification. $html = str_replace(['


', '


'], ['

 


', '

 


'], $html); $glossary = array_map('trim', explode('

 

', $html)); // Create the glossary alphabet, the list of current letters and current definitions and prepare first letters. foreach ($glossary as $key => $termDefinition) { $pos = mb_strpos($termDefinition, '

'); if (!$pos) { unset($glossary[$key]); continue; } $term = trim(mb_substr($termDefinition, 0, $pos + 4)); if (strip_tags($term) === '') { unset($glossary[$key]); continue; } $definition = trim(mb_substr($termDefinition, $pos + 5)); $glossary[$key] = [ 'term' => $term, 'definition' => $definition, ]; } $glossary = array_values($glossary); ?> $heading, 'glossary' => $glossary, 'isHtml' => true, 'divclass' => $divclass, ]) ?>