mcp-scraper 0.58.0 → 0.60.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.
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.60.0";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-AQA2ZL4X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.60.0'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -102,14 +102,28 @@ function setTheme(theme) {
102
102
  storageSet(`${state.storageKey}:theme`, theme);
103
103
  }
104
104
 
105
+ function editionBasePath() {
106
+ const path = new URL(window.location.href).pathname.replace(/\/+$/, "");
107
+ const editionMatch = path.match(/^(\/editions\/[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/[a-z0-9-]+)?$/);
108
+ return editionMatch ? editionMatch[1] : "";
109
+ }
110
+
105
111
  function routeSlug() {
106
- return new URL(window.location.href).searchParams.get("article");
112
+ const url = new URL(window.location.href);
113
+ const legacy = url.searchParams.get("article");
114
+ if (legacy) return legacy;
115
+ const path = url.pathname.replace(/\/+$/, "");
116
+ const base = editionBasePath();
117
+ const remainder = base ? path.slice(base.length) : path;
118
+ const match = remainder.match(/^\/([a-z0-9]+(?:-[a-z0-9]+)*)$/);
119
+ return match ? match[1] : null;
107
120
  }
108
121
 
109
122
  function articleUrl(slug, section = "") {
110
123
  const url = new URL(window.location.href);
111
- if (slug) url.searchParams.set("article", slug);
112
- else url.searchParams.delete("article");
124
+ const base = editionBasePath();
125
+ url.pathname = slug ? `${base}/${slug}` : `${base || "/"}`;
126
+ url.searchParams.delete("article");
113
127
  url.hash = section ? `#${section}` : "";
114
128
  return `${url.pathname}${url.search}${url.hash}`;
115
129
  }