File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 41
41
# let __glossary_is_empty = " glossary_is_empty"
42
42
# let __entry_has_neither_short_nor_long = " entry_has_neither_short_nor_long"
43
43
# let __make_glossary_not_called = " make_glossary_not_called"
44
+ # let __capitalize_called_with_content_type = " __capitalize_called_with_content_type"
44
45
# let __unknown_error = " unknown_error"
45
46
46
47
// __error_message(key, kind, ..kwargs) -> str
67
68
msg = " entry '" + key + " ' has neither short nor long form"
68
69
} else if kind == __glossary_is_empty {
69
70
msg = " glossary is empty. Use `register-glossary(entry-list)` immediately after `make-glossary`."
71
+ } else if kind == __capitalize_called_with_content_type {
72
+ msg = (
73
+ " Capitalization was requested for " + key + " , but short or long is of type content. Use a string instead."
74
+ )
70
75
} else if kind == __make_glossary_not_called {
71
76
msg = " make-glossary not called. Add `#show: make-glossary` at the beginning of the document."
72
77
} else {
77
82
return __glossarium_error_prefix + msg
78
83
}
79
84
80
- # let __capitalize (text : "" ) = {
85
+ # let __capitalize (text ) = {
81
86
if text == "" { return text }
87
+ if type (text ) == content {
88
+ panic (__error_message (key , __capitalize_called_with_content_type ))
89
+ }
82
90
return upper (text . first ()) + text . slice (1 )
83
91
}
84
92
You can’t perform that action at this time.
0 commit comments