Small fix: val.strip() does not do anything because python strip returns a copy of the string. The author meant val = val.strip()
hack to allow markdown formatted text in .bib