@escape-game-over/atlas 0.1.21 → 0.1.22

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/llms.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
package/src/llms.ts CHANGED
@@ -151,10 +151,18 @@ export function buildLlms(input: LlmsInput): GeneratedFile {
151
151
  lines.push("");
152
152
  }
153
153
 
154
+ // Opens with a byte-order mark, because `contentType` does not survive the
155
+ // build. Only the dev middleware sends it; once written to `dist` the file
156
+ // is served with whatever the host picks, and `astro preview` picks
157
+ // `text/plain` with no charset. A browser then reads the bytes as
158
+ // Windows-1252, and every `—`, `²` and line of Greek turns to `—`. This
159
+ // is the one generated file written in prose, so it is the one that breaks.
160
+ // The mark is the encoding stated by the bytes themselves, which a browser
161
+ // honours over a missing charset and a UTF-8 decoder strips.
154
162
  return {
155
163
  name: input.name,
156
164
  url: joinUrl(input.siteUrl, `/${input.name}`),
157
- body: `${lines.join("\n").trimEnd()}\n`,
165
+ body: `\uFEFF${lines.join("\n").trimEnd()}\n`,
158
166
  contentType: "text/markdown; charset=utf-8",
159
167
  };
160
168
  }