On Mac OS sed can't replace characters to new lines.
I replaced to tabs in sed, with knowing there were no tab exists as I deleted them before, and then by tr I replaced all tabs by new lines, hopefully in a portable way.
New DNS API implementation for acme.sh script use WEDOS's WAPI XML interface to manage domain TXT entries. Both add and remove methods works. The code were tested successfully and spellchecked too. It seems there is no issue at all. The script skeleton from cloudfare were used.