typogrify
typogrify copied to clipboard
caps: support characters with diacritics (e.g. ÄÖÜ) in caps words
Currently the caps filter is only able to recognize caps words written only using A-Z, which works fine for English texts, but makes problems once you change to German or French for example. During looking this up, I noticed it is quite complicated to do that using regular expressions/re
. The regex
package might help, where you can use \p{Lu}
to match all uppercase unicode characters, but that would add another dependency.
Another possibility might be to somehow use pythons .isupper()
method for string objects which does work with characters with diacritics.