Original code:
[code]
$documentSymbol = explode(self::$_templateSymbol, self::$_document);
$i = 0;
foreach ($documentSymbol as $documentSymbolValue) {
// avoid first and last values, and tag elements
if ($i == 0 || $i == count($documentSymbol)
|| $documentSymbolValue[0] == '<') {
$i++;
continue;
} else {
$variables['document'][] = strip_tags($documentSymbolValue);
$i++;
}
}
[/code]
My code:
[code]
$documentSymbol = explode(self::$_templateSymbol, strip_tags(self::$_document));
$i = 0;
foreach ($documentSymbol as $documentSymbolValue) {
if ($i % 2 == 0) {
$i++;
continue;
} else {
$variables['document'][] = strip_tags($documentSymbolValue);
$i++;
}
}
[/code]
In the case I faced the spellchecker added xml markup directly after the delimiter, so the if-case fired and the loop continued without adding the variable. I think there was a reason you wrote the code the way you did it. So am I missing something?