Skip to content

Escaping date-like data in square brackets #631

Closed

Description

@micahellison

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?

Activity

  1. wren commented on Jul 24, 2019

    @wren
    Member

    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.

  2. added
    bugSomething isn't working
    on Jul 28, 2019
  3. added this to the v2.0-rc4 milestone on Aug 3, 2019
  4. micahellison commented on Aug 3, 2019

    @micahellison
    MemberAuthor

    Once this is fixed, it should resolve #625.

  5. self-assigned this
    on Aug 3, 2019
  6. wren commented on Aug 3, 2019

    @wren
    Member

    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.

  7. added a commit that references this issue on Aug 10, 2019
  8. added 2 commits that reference this issue on Aug 13, 2019
  9. added a commit that references this issue on Apr 18, 2020
  10. lock commented on May 21, 2020

    @lock

    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.

  11. locked as resolved and limited conversation to collaborators on May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🔒OutdatedbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions