orgapp / orgajs

parse org-mode content into AST
https://orga.js.org
MIT License
614 stars 62 forks source link

Not handling files with CRLF #46

Open gitonthescene opened 4 years ago

gitonthescene commented 4 years ago

Parsing this example produces odd results. More specifically, the table isn't parsed properly. I think changing this split to be /\r\n|\n/ fixes this issue. I'm happy to make a pull request if you'd like.

xiaoxinghu commented 4 years ago

@gitonthescene I suspect that this should be fixed in v2 (kind of 😄 ). Possible issue is that the \r is potentially being contained by the token prior to the \r\n. But I think it's mostly OK? Can you try it in the new version? Thanks.

gitonthescene commented 4 years ago

Thanks. It definitely parses that example now, though I don't see any mention of \r in the code anywhere. I'll let you know if I notice any issues with this.

xiaoxinghu commented 4 years ago

yes, here is the logic for breaking text into lines, it's a different way of maintaining the line positions since now we have to keep the Position info in our nodes. IMHO, it's probably not going to do any significant harm right now. 🤞