#1167562 by dereine: Fix index for the format key and take sure that there is always an format given to check_markup