def __format_occurence(self, occurence):
        """
        Formats the given occurence and returns the matching rich html text.

        :param occurence: Occurence to format.
        :type occurence: Occurence
        :return: Rich text.
        :rtype: unicode
        """

        color = "rgb({0}, {1}, {2})"
        span_format = "<span style=\"color: {0};\">{{0}}</span>".format(color.format(self.__default_line_color.red(),
                                                                                     self.__default_line_color.green(),
                                                                                     self.__default_line_color.blue()))
        line = foundations.strings.to_string(occurence.text)
        start = span_format.format(line[:occurence.column])
        pattern = "<b>{0}</b>".format(line[occurence.column:occurence.column + occurence.length])
        end = span_format.format(line[occurence.column + occurence.length:])
        return "".join((start, pattern, end))
Formats the given occurence and returns the matching rich html text.

        :param occurence: Occurence to format.
        :type occurence: Occurence
        :return: Rich text.
        :rtype: unicode