def METHOD_NAME(data):
    blocks = data.get("blocks")
    entity_map = data.get("entityMap")
    if not blocks:
        return data
    editor_js_blocks = []
    list_data = {}
    for block in blocks:
        # if block doesn't have key it means it isn't in draft.js format
        if "key" not in block:
            return data
        key = block["type"]
        inline_style_ranges = block["inlineStyleRanges"]
        entity_ranges = block["entityRanges"]
        text = block["text"]
        text = parse_text(text, inline_style_ranges, entity_ranges, entity_map)
        type, data = get_block_data(text, key, list_data, editor_js_blocks)
        if not type:
            continue
        new_block = {
            "type": type,
            "data": data,
        }
        editor_js_blocks.append(new_block)
    return {"blocks": editor_js_blocks}