def merge_tags(html_tags_offsets):
    """
        Merges html tags if they have the same offset.
        Minds the order in the original list.
    """
    merged = []
    done_offsets = []
    for t1 in html_tags_offsets:
        if t1[0] in done_offsets:
            continue
        tags_with_same_offset = [t for o, t in html_tags_offsets if o == t1[0]]
        new_tag = "".join(tags_with_same_offset)
        merged.append((t1[0], new_tag))  
        done_offsets.append(t1[0])
    return merged