@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.
- package/package.json +1 -1
- package/src/llms.ts +9 -1
package/package.json
CHANGED
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:
|
|
165
|
+
body: `\uFEFF${lines.join("\n").trimEnd()}\n`,
|
|
158
166
|
contentType: "text/markdown; charset=utf-8",
|
|
159
167
|
};
|
|
160
168
|
}
|