Skip to content

Commit 99b29a0

Browse files
committed
feat: update @citolab/qti-components dependency to local file and add yalc.lock
1 parent e6a7163 commit 99b29a0

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@citolab/qti-api": "^8.0.35",
18-
"@citolab/qti-components": "^7.26.0",
18+
"@citolab/qti-components": "file:.yalc/@citolab/qti-components",
1919
"@citolab/qti-convert": "^0.3.52",
2020
"@lit-labs/react": "^2.1.3",
2121
"@lit/context": "^1.1.6",

src/app/store/store.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,13 @@ export const useStore = create<Store>()(
488488
const entry = zip.files[relativePath];
489489
const ext = normalizedPath.split(".").pop()?.toLowerCase() || "";
490490
if (ext === "xml") {
491-
const text = await entry.async("string");
491+
const rawText = await entry.async("string");
492+
// Fix boolean HTML attributes that are invalid XML (e.g., data-content-cycle → data-content-cycle="").
493+
// The quote-aware alternation ensures content inside attribute values is never modified.
494+
const text = rawText.replace(/<[^>]+>/g, (tag) =>
495+
tag.replace(/("[^"]*"|'[^']*')|(\s)([\w:-]+)(?!\s*=)(?=[\s/>])/g,
496+
(m, quoted, space, attr) => quoted !== undefined ? m : `${space}${attr}=""`)
497+
);
492498
xmlContentsByPath.set(normalizedPath, text);
493499
await putTextFileInPackageCache(packageId, normalizedPath, text);
494500
} else {

yalc.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "v1",
3+
"packages": {
4+
"@citolab/qti-components": {
5+
"signature": "f7e5cdba1a94f628f5ca12caea058cd1",
6+
"file": true,
7+
"replaced": "^7.26.0"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)