def customValidation(self):
    (information, warnings, critical) = ([], [], [])
    if self.isEmpty():
        critical.append('Needs to contain at least one language field')
    for langId in self._possible_keys:
        if self.get(langId):
            string = self.get(langId)
            if (len(string) > self._length):
                critical.append(("Language entry '%s' is too long. Allowed are %s characters." % (langId, self._length)))
            if re.findall('(<.+?>)', string):
                if self._markdownAllowed:
                    critical.append(('String contains HTML code, which is not allowed. You may use Markdown for text formatting. String: ' + string))
                else:
                    critical.append(('String contains HTML code, which is not allowed. String: ' + string))
            if ((not self._markdownAllowed) and string and ((('<p>' + string) + '</p>\n') != markdown2.markdown(string))):
                critical.append('String contains Markdown code, which is not allowed.')
    return (information, warnings, critical)
def customValidation(self):
    (information, warnings, critical) = ([], [], [])
    if self.isEmpty():
        critical.append('Needs to contain at least one language field')
    for langId in self._possible_keys:
        if self.get(langId):
            string = self.get(langId)
            if (len(string) > self._length):
                critical.append(("Language entry '%s' is too long. Allowed are %s characters." % (langId, self._length)))
            if re.findall('(<.+?>)', string):
                if self._markdownAllowed:
                    critical.append(('String contains HTML code, which is not allowed. You may use Markdown for text formatting. String: ' + string))
                else:
                    critical.append(('String contains HTML code, which is not allowed. String: ' + string))
            if ((not self._markdownAllowed) and string and ((('<p>' + string) + '</p>\n') != markdown2.markdown(string))):
                critical.append('String contains Markdown code, which is not allowed.')
    return (information, warnings, critical)