docs: def split_citations(citation_elements):
      """Split a citation line in multiple citations
  
      We handle the case where the author has put 2 citations in the same line
      but split with ; or some other method.
      """
      splitted_citations = []
      new_elements = []
      current_recid = None
      current_doi = None
  
      def check_ibid(current_elements, trigger_el):
          for el in new_elements:
              if el['type'] == 'AUTH':
                  return
  
          # Check for ibid
          if trigger_el.get('is_ibid', False):
              if splitted_citations:
                  els = chain(reversed(current_elements),
                              reversed(splitted_citations[-1]))
              else:
                  els = reversed(current_elements)
              for el in els:
                  if el['type'] == 'AUTH':
                      new_elements.append(el.copy())
                      break
  
      def start_new_citation():
          """Start new citation"""
          splitted_citations.append(new_elements[:])
          del new_elements[:]
  
      for el in citation_elements:
          try:
              el_recid = el['recid']
          except KeyError:
              el_recid = None
  
          if current_recid and el_recid and current_recid == el_recid:
              # Do not start a new citation
              pass
          elif current_recid and el_recid and current_recid != el_recid \
                  or current_doi and el['type'] == 'DOI' and \
                  current_doi != el['doi_string']:
              start_new_citation()
              # Some authors may be found in the previous citation
              balance_authors(splitted_citations, new_elements)
          elif ';' in el['misc_txt']:
              misc_txt, el['misc_txt'] = el['misc_txt'].split(';', 1)
              if misc_txt:
                  new_elements.append({'type': 'MISC',
                                       'misc_txt': misc_txt})
              start_new_citation()
              # In case el['recid'] is None, we want to reset it
              # because we are starting a new reference
              current_recid = el_recid
              while ';' in el['misc_txt']:
                  misc_txt, el['misc_txt'] = el['misc_txt'].split(';', 1)
                  if misc_txt:
                      new_elements.append({'type': 'MISC',
                                           'misc_txt': misc_txt})
                      start_new_citation()
                      current_recid = None
  
          if el_recid:
              current_recid = el_recid
  
          if el['type'] == 'DOI':
              current_doi = el['doi_string']
  
          check_ibid(new_elements, el)
          new_elements.append(el)
  
      splitted_citations.append(new_elements)
  
      return [el for el in splitted_citations if not empty_citation(el)]