I have a text string with well defined new lines and spaces but I don’t know how to properly display such text in markdown.
text = "This markdown\n should look \n like this" print(text) This markdown should look like this
How’d I transform such text to proper markdown to be input in:
Right now it looks like this in markdown:
This markdown should look like this
So it’s basically eliminating spaces and new lines. Generally I want a function that transforms text string to markdown and keeps spaces and new lines formatting. I know I can fix this by just writing text differently, i.e.,
text = “”"
But this is manual and cannot scale for a large text that’s already formatted with /n and spaces.
I’d ideally want a function that takes any input text string and transform it into markdown format.