@quartz-community/bases-page 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0728d19: Fix transclusion of base views with spaces in the name. The OFM plugin slugifies the fragment (e.g., `French Philosophers` → `french-philosophers`) but the view lookup expected the original name. View matching now normalizes both sides by lowercasing and replacing spaces with hyphens.
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -18502,8 +18502,9 @@ function createBasesCodeblockTransform(opts) {
18502
18502
  function renderBasesInline(basesData, allFiles, locale, localeStrings, opts, slug, allSlugs, linkResolution, viewName, selfContext) {
18503
18503
  let views = basesData.views ?? [];
18504
18504
  if (viewName) {
18505
- const viewNameLower = viewName.toLowerCase();
18506
- views = views.filter((v2) => v2.name?.toLowerCase() === viewNameLower);
18505
+ const normalize2 = (s3) => s3.toLowerCase().replace(/\s+/g, "-");
18506
+ const viewNameNorm = normalize2(viewName);
18507
+ views = views.filter((v2) => v2.name !== void 0 && normalize2(v2.name) === viewNameNorm);
18507
18508
  if (views.length === 0) {
18508
18509
  return `<div class="bases-empty">View &quot;${viewName}&quot; not found</div>`;
18509
18510
  }