kuchejak / obsidian-bible-linker-plugin

Obsidian.md plugin that allows you to link multiple bible verses easily
MIT License
80 stars 6 forks source link

Support non-Latin characters #26

Closed al3xw closed 1 year ago

al3xw commented 1 year ago

If a verse is copied/linked from a book with non-Latin characters, the characters before and the non-Latin character are cut off in the naming of the link.

Example: Input: Matthäus 1.1 Output: [[Matthäus-01#v1|us 1.1]] Expected Output: [[Matthäus-01#v1|Matthäus 1.1]]

al3xw commented 1 year ago

A sufficient fix is to adjust the following regex in regexes.ts to:

// Can be used to determine whether given name of file is from OBSK (for example Gen-01)
export const isOBSKFile = /([A-zÀ-ž0-9 ]+)-(\d{2,3})/

JavaScript doesn't support unicode character classes (\p{L} doesn't work). But using À-ž seems a good workaround.

kuchejak commented 1 year ago

Should be fixed now (version 1.4.5)