aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta/conf_make_meta_json.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc_reform/meta/conf_make_meta_json.d')
-rw-r--r--src/doc_reform/meta/conf_make_meta_json.d15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d
index 0a3c4c2..3d69a3c 100644
--- a/src/doc_reform/meta/conf_make_meta_json.d
+++ b/src/doc_reform/meta/conf_make_meta_json.d
@@ -393,16 +393,21 @@ static template contentJSONtoDocReformStruct() {
= _struct_composite.meta.creator_author.split(rgx.arr_delimiter);
auto _lastname = appender!(char[])();
foreach (author_raw; authors_raw_arr) {
- author_arr ~= author_raw.replace(rgx.raw_author_munge, "$2 $1");
- authors_hash_arr["first"] ~= author_raw.replace(rgx.raw_author_munge, "$2");
- authors_hash_arr["last"] ~= author_raw.replace(rgx.raw_author_munge, "$1");
- authors_hash_arr["full"] ~= author_raw.replace(rgx.raw_author_munge, "$2 $1");
- authors_hash_arr["as_input"] ~= author_raw;
if (auto m = author_raw.match(rgx.raw_author_munge)) {
+ author_arr ~= author_raw.replace(rgx.raw_author_munge, "$2 $1");
+ authors_hash_arr["first"] ~= author_raw.replace(rgx.raw_author_munge, "$2");
+ authors_hash_arr["last"] ~= author_raw.replace(rgx.raw_author_munge, "$1");
+ authors_hash_arr["full"] ~= author_raw.replace(rgx.raw_author_munge, "$2 $1");
(m.captures[1]).map!toUpper.copy(_lastname);
authors_hash_arr["last_first"] ~= _lastname.data.to!string ~ ", " ~ m.captures[2];
_lastname = appender!(char[])();
+ } {
+ author_arr ~= author_raw;
+ authors_hash_arr["last"] ~= author_raw;
+ authors_hash_arr["full"] ~= author_raw;
+ authors_hash_arr["last_first"] ~= author_raw;
}
+ authors_hash_arr["as_input"] ~= author_raw;
}
_struct_composite.meta.creator_author_arr = author_arr;
_struct_composite.meta.creator_author = author_arr.join(", ").chomp.chomp;