Closed thombruce closed 1 year ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Lines | 92.09% / 60% | 897 / 974 |
🟢 | Statements | 92.09% / 60% | 897 / 974 |
🟢 | Functions | 70.83% / 60% | 68 / 96 |
🟢 | Branches | 89.68% / 60% | 113 / 126 |
The idea is to be able to decorate tags within a todo. I already have the regular expression for identifying them, so it's just a question of how to decorate them...
Probably replace +pattern
in todo.text
with <a href="" class="project-tag">+pattern</a>
.
https://github.com/thombruce/toodles/pull/61/commits/4ff307f0aaf88b08724f5d24bbbd7accc252cfb3 is not ideal, but it works.
Would like to move the todo text interface into a separate component. Would like to style the links. And would like to be able to click them without this being captured instead by the contenteditable area.
Would prefer, rather than parsing and replacing with raw HTML, to:
https://github.com/thombruce/toodles/pull/61/commits/077c905f5b92d8d237c580c5db6b6f5a1fc3f5bf
This is most of the way there, but it looks like items after splitting the text are not reactive. After input is complete and the todo is saved, the element should act as though whatever new project tag was added had always been there and display it in the highlighted style.
Bonus points if the highlight can be created while in the act of editing. It can. I just need to shift some pieces around.
Reminder: Toodles is heavily overengineered and in serious need of refactoring. 🙃 I might do this next, particularly if my solution to the above is sloppy.
closes #54