fix bug of displaying long string in location input when previewing md file