@syncfusion/ej2-inputs 30.1.38 → 30.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -489,14 +489,26 @@ var Input;
489
489
  return container;
490
490
  }
491
491
  function encodePlaceHolder(placeholder) {
492
- var result = '';
493
- if (!isNullOrUndefined(placeholder) && placeholder !== '') {
494
- var spanEle = document.createElement('span');
495
- spanEle.innerHTML = '<input placeholder="' + placeholder + '"/>';
496
- var hiddenInput = (spanEle.children[0]);
497
- result = hiddenInput.placeholder;
492
+ if (placeholder == null || placeholder === '') {
493
+ return '';
498
494
  }
499
- return result;
495
+ var decoded = decodeHtmlEntities(placeholder);
496
+ return decoded;
497
+ }
498
+ function decodeHtmlEntities(str) {
499
+ var entityMap = {
500
+ '&amp;': '&',
501
+ // eslint-disable-next-line quotes
502
+ '&quot;': '"',
503
+ // eslint-disable-next-line quotes
504
+ '&#39;': "'",
505
+ '&lt;': '<',
506
+ '&gt;': '>',
507
+ '&eacute;': 'é' // tslint:disable-line:comma-dangle
508
+ };
509
+ // tslint:disable-next-line:typedef
510
+ // tslint-disable-next-line security/detect-object-injection
511
+ return str.replace(/&[a-zA-Z#0-9]+;/g, function (entity) { return entityMap[entity] || entity; });
500
512
  }
501
513
  /**
502
514
  * Sets the value to the input element.