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

Support appending date/text before block ID #10

Closed
wenlzhang opened this issue Oct 25, 2021 · 11 comments · Fixed by #22
Closed

Support appending date/text before block ID #10

wenlzhang opened this issue Oct 25, 2021 · 11 comments · Fixed by #22

Comments

@wenlzhang
Copy link

With the current version of this plugin, date/text would be appended after block ID, if any:
- [x] Task ^blockid 2021-10-25

However, this may break the block ID. Therefore, is it possible to append date/text before the block ID, if any?
- [x] Task 2021-10-25 ^blockid

@ebullient
Copy link
Owner

“may” break or does break?

@wenlzhang
Copy link
Author

wenlzhang commented Oct 27, 2021

“may” break or does break?

In fact, it does break block links in my case.

@wenlzhang
Copy link
Author

With version 0.6.5, I still experience this issue.

@ebullient
Copy link
Owner

Please give me a more concrete example (with text).
Block references should be preserved / remain at the end of the line.
If you can suggest a revision to this test:

test('Correctly inserts item ahead of block references', () => {
, that would be excellent.

@wenlzhang
Copy link
Author

wenlzhang commented Jan 10, 2022

I did some tests with different block IDs, and the finding is interesting, as can be seen below.

  • With the block ID ^your-id, as in the test file, it works as expected.
  • With the block ID ^ho1nmr, it does not work.

CleanShot 2022-01-10 at 14 43 16

The tests were done with the following conditions:

  • The plugin version 0.6.5 was used.
  • The block ID was randomly generated by using the following plugin:
  • [[completion::]YYYY-MM-DD[]] was configured to append text after completion, as in the test file.

@ebullient
Copy link
Owner

Thank you! The specific example helps a lot. ;)

@ebullient
Copy link
Owner

I forgot numbers in the regex. 🤦‍♀️

@wenlzhang
Copy link
Author

wenlzhang commented Jan 10, 2022

I forgot numbers in the regex. 🤦‍♀️

Also, I am not sure if that plugin would generate other characters in block IDs.

@ebullient
Copy link
Owner

I think, based on Obsidian Help, that we're good:
image

I knew I had to support numbers.. not sure how they didn't end up in the regex. Probably because my test didn't have one!

@wenlzhang
Copy link
Author

I think, based on Obsidian Help, that we're good:

That's glad to know!

@ebullient
Copy link
Owner

Ok. Updated in 0.6.6 (which I just pushed, and should be updatable via BRAT).. let me know if I still messed something up! grr. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants