MOBILE-4247 edit: Add field#name and field#description

main
Alfonso Salces 2023-05-04 12:17:29 +02:00
parent 8e03587701
commit 9488e22518
1 changed files with 14 additions and 0 deletions

View File

@ -438,6 +438,20 @@ export class AddonModDataEditPage implements OnInit {
replaceRegEx = new RegExp(replace, 'gi');
template = template.replace(replaceRegEx, 'field_' + field.id);
// Replace the field name tag.
replace = '[[' + field.name + '#name]]';
replace = replace.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
replaceRegEx = new RegExp(replace, 'gi');
template = template.replace(replaceRegEx, field.name);
// Replace the field description tag.
replace = '[[' + field.name + '#description]]';
replace = replace.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
replaceRegEx = new RegExp(replace, 'gi');
template = template.replace(replaceRegEx, field.description);
});
const regex = new RegExp('##otherfields##', 'gi');