Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping date-like data in square brackets #631

Closed
micahellison opened this issue Jul 24, 2019 · 4 comments
Closed

Escaping date-like data in square brackets #631

micahellison opened this issue Jul 24, 2019 · 4 comments
Assignees
Labels
bug Something isn't working 🔒 Outdated
Milestone

Comments

@micahellison
Copy link
Member

1.x.x journals store dates plainly on a single line without any special text, but 2.0 wraps its dates in square brackets. It's a good change, and it works fine, except when we run into entries that have square brackets in them. There's a way around this problem (#630) but it's a bit of a rabbit hole.

In the meantime, it seems like we could simple "escape" anything that looks like a date when upgrading journals and saving new/edited entries. This could be as simple as adding a space before any line wrapped in brackets. It would still be readable in plain-text, but it couldn't possibly be interpreted as a date by jrnl.

Any thoughts on this?

@wren
Copy link
Member

wren commented Jul 24, 2019

I agree with this. We need to make this a bit more robust before asking everyone to upgrade their v1 journals. I like the space before a bracket, and could likely be done in the jrnl v1 → v2 migration code.

We should really add more tests to this functionality, too.

@wren wren added the bug Something isn't working label Jul 28, 2019
@wren wren added this to the v2.0-rc4 milestone Aug 3, 2019
@micahellison
Copy link
Member Author

Once this is fixed, it should resolve #625.

@wren wren self-assigned this Aug 3, 2019
@wren
Copy link
Member

wren commented Aug 3, 2019

After looking through this more, I think that this escaping should only happen on upgrade from old jrnl versions. If we do it on saving an entry, it opens a huge rabbit-hole into what happens during editing, and users could lose the ability to split/merge/delete/add entries while editing.

wren added a commit to wren/jrnl that referenced this issue Aug 10, 2019
micahellison added a commit that referenced this issue Aug 13, 2019
micahellison added a commit that referenced this issue Aug 13, 2019
@wren wren closed this as completed Aug 15, 2019
wren added a commit that referenced this issue Apr 18, 2020
@lock
Copy link

lock bot commented May 21, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 🔒 Outdated
Projects
None yet
Development

No branches or pull requests

2 participants