diff options
author | Robert Alessi <alessi@robertalessi.net> | 2017-12-30 17:58:41 +0100 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2017-12-30 17:58:41 +0100 |
commit | a11be346f0676235ac7ef2fce518fc38cd4417a7 (patch) | |
tree | b923822ea7d351c73ffb2bb8db131b52e9dff13a | |
parent | f7468f0f433dc2a26934159a9cf085b9730549fe (diff) | |
download | arabluatex-a11be346f0676235ac7ef2fce518fc38cd4417a7.tar.gz |
\cap{} should handle proper names made of several words
-rw-r--r-- | arabluatex.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arabluatex.lua b/arabluatex.lua index f6890ed..593dc6c 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -674,15 +674,24 @@ function cap(str) | |||
674 | str = string.gsub(str, "([^\\]%-['`])", "%1\\MakeUppercase ") | 674 | str = string.gsub(str, "([^\\]%-['`])", "%1\\MakeUppercase ") |
675 | str = string.gsub(str, "([^\\]%-ʿ)", "%1\\MakeUppercase ") | 675 | str = string.gsub(str, "([^\\]%-ʿ)", "%1\\MakeUppercase ") |
676 | str = string.gsub(str, "([^\\]%-ʾ)", "%1\\MakeUppercase ") | 676 | str = string.gsub(str, "([^\\]%-ʾ)", "%1\\MakeUppercase ") |
677 | elseif string.find(str, "[^\\]%-[^'`ʾʿ]") then | 677 | end |
678 | str = string.gsub(str, "([^\\]%-)", "%1\\MakeUppercase ") | 678 | if string.find(str, "[^\\]a?%-[^'`ʾʿ]") then |
679 | elseif string.find(str, "^['`ʾʿ]") then | 679 | str = string.gsub(str, "([^\\]a?%-)", "%1\\MakeUppercase ") |
680 | end | ||
681 | if string.find(str, "^['`ʾʿ]") then | ||
680 | str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ") | 682 | str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ") |
681 | str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ") | 683 | str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ") |
682 | str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ") | 684 | str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ") |
683 | else | ||
684 | str = "\\MakeUppercase "..str | ||
685 | end | 685 | end |
686 | if string.find(str, "%s['`ʾʿ]") then | ||
687 | str = string.gsub(str, "(%s['`][^%-])", "%1\\MakeUppercase ") | ||
688 | str = string.gsub(str, "(%sʿ)", "%1\\MakeUppercase ") | ||
689 | str = string.gsub(str, "(%sʾ)", "%1\\MakeUppercase ") | ||
690 | end | ||
691 | -- str = string.gsub(str, "(%s[^'`ʾʿ])", "%1\\MakeUppercase ") | ||
692 | -- else | ||
693 | str = "\\MakeUppercase "..str | ||
694 | -- end | ||
686 | return "\\txtrans{"..str.."}" | 695 | return "\\txtrans{"..str.."}" |
687 | end | 696 | end |
688 | 697 | ||