'Processes a block and setup its folding info.
This method call ``detect_fold_level`` and handles most of the tricky
corner cases so that all you have to do is focus on getting the proper
fold level foreach meaningful block, skipping the blank ones.
:param current_block: current block to process
:param previous_block: previous block
:param text: current block text'

def process_block(self, current_block, previous_block, text):

    prev_fold_level = TextBlockHelper.get_fold_lvl(previous_block)
    if ((text.strip() == '') or self.editor.is_comment(current_block)):
        fold_level = prev_fold_level
    else:
        fold_level = self.detect_fold_level(previous_block, current_block)
        if (fold_level > self.limit):
            fold_level = self.limit
    prev_fold_level = TextBlockHelper.get_fold_lvl(previous_block)
    if (fold_level > prev_fold_level):
        block = current_block.previous()
        while (block.isValid() and ((block.text().strip() == '') or self.editor.is_comment(block))):
            TextBlockHelper.set_fold_lvl(block, fold_level)
            block = block.previous()
        TextBlockHelper.set_fold_trigger(block, True)
    if (text.strip() and (not self.editor.is_comment(previous_block))):
        TextBlockHelper.set_fold_trigger(previous_block, (fold_level > prev_fold_level))
    TextBlockHelper.set_fold_lvl(current_block, fold_level)
    prev = current_block.previous()
    if (prev and prev.isValid() and ((prev.text().strip() == '') or self.editor.is_comment(prev)) and TextBlockHelper.is_fold_trigger(prev)):
        TextBlockHelper.set_collapsed(current_block, TextBlockHelper.is_collapsed(prev))
        TextBlockHelper.set_fold_trigger(prev, False)
        TextBlockHelper.set_collapsed(prev, False)
