adapt the texts editor to handle conditional documents/api