Merge pull request #3659 from alfonso-salces/MOBILE-4247

MOBILE-4247 edit: Add field#name and field#description
main
Dani Palou 2023-05-04 12:32:42 +02:00 committed by GitHub
commit deb6be243a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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');