@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.
@@ -486,14 +486,26 @@ var Input;
486
486
  return container;
487
487
  }
488
488
  function encodePlaceHolder(placeholder) {
489
- let result = '';
490
- if (!isNullOrUndefined(placeholder) && placeholder !== '') {
491
- const spanEle = document.createElement('span');
492
- spanEle.innerHTML = '<input placeholder="' + placeholder + '"/>';
493
- const hiddenInput = (spanEle.children[0]);
494
- result = hiddenInput.placeholder;
489
+ if (placeholder == null || placeholder === '') {
490
+ return '';
495
491
  }
496
- return result;
492
+ const decoded = decodeHtmlEntities(placeholder);
493
+ return decoded;
494
+ }
495
+ function decodeHtmlEntities(str) {
496
+ const entityMap = {
497
+ '&amp;': '&',
498
+ // eslint-disable-next-line quotes
499
+ '&quot;': '"',
500
+ // eslint-disable-next-line quotes
501
+ '&#39;': "'",
502
+ '&lt;': '<',
503
+ '&gt;': '>',
504
+ '&eacute;': 'é' // tslint:disable-line:comma-dangle
505
+ };
506
+ // tslint:disable-next-line:typedef
507
+ // tslint-disable-next-line security/detect-object-injection
508
+ return str.replace(/&[a-zA-Z#0-9]+;/g, (entity) => entityMap[entity] || entity);
497
509
  }
498
510
  /**
499
511
  * Sets the value to the input element.