Newline logic in stringify modifies the original markdown #96

Open
opened 2019-05-14 20:44:37 +00:00 by katz12 · 4 comments
katz12 commented 2019-05-14 20:44:37 +00:00 (Migrated from github.com)

The logic for newline in stringify.js will add a newline to the end of the markdown document if it did not already exist.

This is obviously a matter of opinion, but I think it would be best if stringify did not alter the original markdown in any way except to add front matter.

The logic for [newline](https://github.com/jonschlinkert/gray-matter/blob/master/lib/stringify.js#L54) in stringify.js will add a newline to the end of the markdown document if it did not already exist. This is obviously a matter of opinion, but I think it would be best if stringify did not alter the original markdown in any way except to add front matter.
robertmassaioli commented 2019-05-20 04:04:17 +00:00 (Migrated from github.com)

@katz12 What impact is this having on your Markdown documents, and how they are used / rendered, if any? Currently, this seems like a low priority issue.

@katz12 What impact is this having on your Markdown documents, and how they are used / rendered, if any? Currently, this seems like a low priority issue.
katz12 commented 2019-05-20 15:38:39 +00:00 (Migrated from github.com)

The impact is fairly use case specific, but I have a need to ensure that a markdown document does not change in any unexpected ways.

Feel free to treat this as low priority as I have changed my approach and am no longer using gray-matter.

The impact is fairly use case specific, but I have a need to ensure that a markdown document does not change in any unexpected ways. Feel free to treat this as low priority as I have changed my approach and am no longer using gray-matter.
derek-knox commented 2020-09-03 12:50:36 +00:00 (Migrated from github.com)

Feel free to treat this as low priority as I have changed my approach and am no longer using gray-matter.

@katz12 Out of curiosity, what is your approach now?

> Feel free to treat this as low priority as I have changed my approach and am no longer using gray-matter. @katz12 Out of curiosity, what is your approach now?
katz12 commented 2020-09-03 18:33:48 +00:00 (Migrated from github.com)

I think I ended up hand rolling my own parser/writer that doesn't add newlines. But I also switched to using a JSON format for the front matter, so gray-matter would not have worked for me.

I think I ended up hand rolling my own parser/writer that doesn't add newlines. But I also switched to using a JSON format for the front matter, so gray-matter would not have worked for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rtlabs-llm-agents/gms-gray-matter#96
No description provided.