Remove and return the version(s) from the cached content. First the
        internal version, and if versioning is activated, the template one.
        And finally save the content, but only if all versions match.
        The content saved is the encoded one (if "compress" or
        "compress_spaces" options are on). By doing so, we avoid decoding if
        the versions didn't match, to save some cpu cycles.

def split_content_version(self):
        """
        Remove and return the version(s) from the cached content. First the
        internal version, and if versioning is activated, the template one.
        And finally save the content, but only if all versions match.
        The content saved is the encoded one (if "compress" or
        "compress_spaces" options are on). By doing so, we avoid decoding if
        the versions didn't match, to save some cpu cycles.
        """
        try:
            nb_parts = 2
            if self.options.versioning:
                nb_parts = 3

            parts = self.content.split(self.VERSION_SEPARATOR, nb_parts - 1)
            assert len(parts) == nb_parts

            self.content_internal_version = parts[0]
            if self.options.versioning:
                self.content_version = parts[1]

            self.content = parts[-1]
        except Exception:
            self.content = None