protected static function ListBlockItem($strListItemContent, $strBlockIdentifier) { // Build pattern to identify sublist $intBlockIdentifierLength = strlen($strBlockIdentifier); $strPattern = sprintf('/\\n(%s|%s) /', str_repeat('\\#', $intBlockIdentifierLength + 1), str_repeat('\\*', $intBlockIdentifierLength + 1)); $strToReturn = null; preg_match($strPattern, $strListItemContent, $strMatches); if (count($strMatches) >= 1) { $intPosition = strpos($strListItemContent, $strMatches[0]); $strToReturn .= QTextStyleInline::Process(substr($strListItemContent, 0, $intPosition)); $strListItemContent = substr($strListItemContent, $intPosition + strlen($strMatches[0])); $strToReturn .= QTextStyleBlock::ListBlockRecursion($strListItemContent, $strMatches[1]); } else { $strToReturn .= QTextStyleInline::Process($strListItemContent); } return $strToReturn; }