separate markdown styling stripping into new method