I'm writing a program to convert html to markdown. Unfortunately, the exporter retains the newline characters, "\n", in the html, which means that links are broken in the markdown.
My markdown files are saved in an array like this...
array = ['I am a markdown file. I have l', 'inks contained in me that are ', 'broken like this:[](www.brok\n','enlink.org). This means that a', 'newline is contained in the li', 'nk and the link does not work.']
...where each element of the array is a line of text.
Using Python, I'd like to remove the newline character ("\n") within the link and join the two elements of the array (the element of the array that had the newline and the element directly following it).
I do NOT want to join elements of the array that are not ended in a newline character.
There are a few similar answers on StackOverflow (see this one) but nothing I can find that's comparable to my problem. Any suggestions? I am very new to Python.