@hestia-earth/ui-components 0.9.2 → 0.9.3
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.
|
@@ -385,9 +385,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
385
385
|
* @param value The compound as a string (e.g. NO3)
|
|
386
386
|
* @returns HTML version with subscript and superscript tags.
|
|
387
387
|
*/
|
|
388
|
-
const compoundToHtml = (value) => value
|
|
389
|
-
.replace(/([\d])([\d]{1}[\-\+])/g, '$1<sup>$2</sup>')
|
|
390
|
-
.replace(/([
|
|
388
|
+
const compoundToHtml = (value) => (value || '')
|
|
389
|
+
.replace(/([A-Z]+[\d]+)([\d]{1}[\-\+])/g, '$1<sup>$2</sup>')
|
|
390
|
+
.replace(/([A-Z]+)([\d]{1})([\-\+])/g, '$1<sub>$2</sub><sup>$3</sup>')
|
|
391
391
|
.replace(/([A-LN-Za-ln-z])(\d+)/g, '$1<sub>$2</sub>')
|
|
392
392
|
.replace(/([O])([x])/g, '$1<sub>$2</sub>');
|
|
393
393
|
|