esm7 / obsidian-rtl

RTL support for Obsidian.md
MIT License
137 stars 11 forks source link

Links-only lines always aligned to left on Auto mode #75

Closed yonatankremer closed 2 months ago

yonatankremer commented 3 months ago

Quite a nit-picky one: Couldn't find it in the code as I'm an amateur at best, but as I understand it, the plugin detects if the first letter in each line, and decides if to go rtl or ltr by it. But some lines may be just a link, with the display-name set to another one with the pipe thing ([[link.pdf|new name]]). When setting the display name to one with rtl characters, it always stick left (as the actual first letter in the line is ltr), although it's displayed with just rtl characters. Might be nice to be able to manually change the alignment for each line? Sounds like a fix but lots of work

esm7 commented 3 months ago

The biggest problem with setting a custom line direction that I can see (and prevented me from doing it), is where to store these settings. The plugin can currently store the per-note settings in its settings file or in the note's YAML and that's reasonable, but a custom setting per line is going to be very cumbersome this way (imagine the note's YAML having a big array of line numbers and directions) and very prone to problems (imagine an external program adding a line to the beginning of a note and all the custom directions being on the wrong lines). Propriety editors (e.g. MS Office) enter special invisible characters in the line to denote these things, but I don't think we wanna do that in a Markdown editor.

yonatankremer commented 3 months ago

mm yeah manually does seem like an issue. Changing the auto algorithm might be the call. Would've tried to fix it myself, but it seems like something that'll take more time than I'd like to learn