def converter(markupList, s): for markup in markupList: s = s.replace(markup.oldMarkup, markup.newMarkup) return s