@ucd-lib/theme-elements 3.1.4 → 3.2.0
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucd-lib/theme-elements",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Custom elements for the UCD brand theme",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dompurify": "^2.3.9",
|
|
15
15
|
"ip-cidr": "^3.0.4",
|
|
16
16
|
"lit": "^3.0.2",
|
|
17
|
-
"marked": "^
|
|
17
|
+
"marked": "^16.1.0",
|
|
18
18
|
"photoswipe": "^4.1.3",
|
|
19
19
|
"slim-select": "^1.26.2"
|
|
20
20
|
}
|
|
@@ -64,13 +64,15 @@ export default class UcdlibMd extends LitElement {
|
|
|
64
64
|
* @method updated
|
|
65
65
|
* @description Lit method called when element is updated.
|
|
66
66
|
*/
|
|
67
|
-
updated() {
|
|
67
|
+
updated(changedProperties) {
|
|
68
68
|
// config markdown renderer so elements are correctly styled
|
|
69
69
|
this._setRendererOverrides();
|
|
70
70
|
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
// only process markdown if the data property actually changed
|
|
72
|
+
if (changedProperties.has('data')) {
|
|
73
|
+
const parsedData = DOMPurify.sanitize(marked.parse(this.data));
|
|
74
|
+
this.renderedElement.innerHTML = parsedData;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
/**
|