ChrisVilches/Term-Keep

Formatting issue (markdown + checklists)

Closed this issue · 5 comments

Create a note, and add something like this:

- [x] List all notes for a tag. Must decide: ~~include archived?~~ yes, includes all notes.

When the ~~ is closed, the color goes back to the default color, but it should be dimmed.

  • Are there other similar problems using markdown? (Maybe when creating tags?)
  • Can I set "dimmed" as default so that the ~~ goes back to dimmed after it closes?
  • If I can't fix this, then one option may be to simply remove the dimmed from completed checklist items.

I was able to fix most of the issues by simply tweaking the order in which things are formatted.

image

The current tag formatter returns a text with markdown "code" inside, meaning that it must be put before applying markdown (termimad). This has the effect that it reverts the bold when it's already surrounded by **. I also tried using .bold() but it stops the bold when the tag ends, even if it should continue further (to the right).

Having a tag inside code also works really bad. It seems I don't have many options. Perhaps:

  1. Tell the user that the way to add tags is by doing something that termimad already has (but it doesn't seem to be anything useful), so the formatting is 100% responsibility of termimad.
  2. Don't use any formatting.
  3. Tags can only be in the last line (which is very inconvenient).

image

I will just use this for now. I'll let the user fix it if he thinks the formatting got buggy. I think this kind of things happen in other software as well, so just let the user fix it.

I'm not sure about the "reverse" thing but at least it works using Colorize (Rust crate) so I can trust it works well, I guess. Also, I prefer to use Colorize because it adds some hidden characters, rather than adding markdown code which adds visible characters (the user may get confused as to why they appeared there). So the format may get screwed up, but without showing new characters the user didn't type.

Note also that the long line near the end (the one that says "termimad madness" is just termimad markdown, and it still gets a bit weird. So I guess the user has to fix all of these format mistakes.

image

Worst case scenario isn't that bad, and it's quite rare, so I'm closing this.

Note: Committed to tags branch, not main for now.