chuangcaleb / obsidian-fountain-editor

Obsidian plugin for formatting Fountain screenplay syntax in the editor.
https://obsidian.md/plugins?id=fountain-editor
MIT License
39 stars 2 forks source link

🐛 Characters with accented names not detected as the character token #28

Closed arussbach closed 10 months ago

arussbach commented 10 months ago

Describe the bug

If a characher has an accent in their name, it is not detected as a character.

What's the expected result?

If a character's name is written in cap locks, but contains an accent (ex: ÉTIENNE), it will not be centered as well as the subsequent dialogue.

Steps to reproduce the behavior

write :

ÉTIENNE Hello, my name is Étienne.

and you will see the problem.

Fountain Editor - Plugin Version

v1.1.1

Obsidian Version

v1.5.3

What environment are you seeing the problem on?

Participation

chuangcaleb commented 10 months ago

Hi! This should be because of the regex selector only simply selecting regular alphabetical characters, not accounting for accented letters — just like you diagnosed in your discord message to me.

Yeah yeah, I'll work on this soon! Thanks for opening the bug ticket!

chuangcaleb commented 10 months ago

Extended the regex for Fountain's "character" token to the "capital" letters in the Latin-1 Supplement Unicode block. This should be enough.

Take note that the × (00D7, or ×) unicode character is technically included in the unicode range, so it's recognized as a capital letter, but it's too much regex work to exclude it, so meh.

If we need to extend to the capital letters of the Latin-extended blocks (A, B, whatever), those are much more complicated, please comment below on your requirements. If not, please mark this ticket as closed (I'm not sure if you can? or just comment that it works, then I'll close it myself)

SCR-20240125-kxkw
arussbach commented 10 months ago

Oh! Great, thanks so much, it works perfectly for all my use casses!