We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6308668 commit b4c4bcaCopy full SHA for b4c4bca
src/class/HTMLCodeBlockElement.ts
@@ -126,11 +126,13 @@ export default class HTMLCodeBlockElement extends HTMLElement {
126
return this.#value;
127
}
128
129
- set value(src: string) {
130
- if (/\n$/.test(src)) {
131
- this.#value = `${src}\n`;
+ set value(src: any) {
+ const _src = String(src);
+
132
+ if (/\n$/.test(_src)) {
133
+ this.#value = `${_src}\n`;
134
} else {
- this.#value = src;
135
+ this.#value = _src;
136
137
138
this.#render();
@@ -144,7 +146,7 @@ export default class HTMLCodeBlockElement extends HTMLElement {
144
146
return this.#label;
145
147
148
- set label(value: string) {
149
+ set label(value: any) {
150
if (value === null) {
151
this.#label = '';
152
this.removeAttribute('label');
0 commit comments