Skip to content
Source
Sign inSign up
TanStack/markdown

IMO utils.js regexp \r\n? should be \r?\n #6

Send to my agent
Closedpmario(GitHub profile, opens in a new tab) opened this issue 1 comment

Hi,

Interesting project.

Just visited the utils.js code and line 12 caught my eye. Are you sure, the second replace is right? I am pretty confident, that in Windows \r is optional. IMO replace(/\r\n?/g, '\n') seems to be a noOp as it is atm. IMO it should be replace(/\r?\n/g, '\n')

https://github.com/TanStack/markdown/blob/b54cce0943009ff76063b7656f99c2139823835f/src/utils.ts#L11-L13

I did not test any code, it just caught my attention. Have fun!

  1. pmario(GitHub profile, opens in a new tab) changed the title

  2. I think I was overzealous ...

Sign in to join this conversation.