jsarafajr / slackify-markdown

Convert markdown into Slack-specific markdown
MIT License
129 stars 25 forks source link

Make text replace newlines with spaces #14

Open buob opened 4 years ago

buob commented 4 years ago

Full test case incoming, but this is to fix the situation that we were running into where if an anchor had a newline in it, it wouldn't convert the anchor. This just turns the newline into a whitespace if it shows up in a text node. It doesn't break all newlines, I'm assuming by this function call it's already converted the typical newlines into other node types, and this is only when the parser assumes it's text.

It might not be the best solution given the docs on common mark option lead me to believe that newlines in anchor text are actually valid... not sure if that means it renders them as a line break or just that they're valid.

jsarafajr commented 4 years ago

Hi @buob, could you elaborate on this one please? It seems like it's a breaking change.

Also, this case should probably be covered by a new test.

buob commented 3 years ago

@jsarafajr Sorry about the lazy PR -- just updated the description, not sure if you have any thoughts on whether this is the best approach or not given the problem.

I'll definitely be submitting a proper test case soon.