ework-web 0.10.41 → 0.10.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-web",
3
- "version": "0.10.41",
3
+ "version": "0.10.42",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
@@ -191,17 +191,18 @@ function renderFileContent(
191
191
  const ext = (rawPath.split(".").pop() || "").toLowerCase();
192
192
  const isMd = ext === "md" || ext === "markdown";
193
193
  const lang = extToLang(rawPath);
194
- const fullText = data.rows.map((r) => r.t).join("\n");
195
- const shownBytes = data.rows.reduce((s, r) => s + r.t.length + 1, 0);
194
+ const sorted = [...data.rows].sort((a, b) => a.n - b.n);
195
+ const fullText = sorted.map((r) => r.t).join("\n");
196
+ const shownBytes = sorted.reduce((s, r) => s + r.t.length + 1, 0);
196
197
 
197
198
  let body: string;
198
199
  if (isMd) {
199
200
  body = `<div class="md-render">${renderMarkdown(fullText, "")}</div>`;
200
201
  } else if (lang && shownBytes <= 256000) {
201
- const nums = data.rows.map((r) => r.n).join("\n");
202
+ const nums = sorted.map((r) => r.n).join("\n");
202
203
  body = `<div class="fv-code"><pre class="fv-gutter">${escapeHtml(nums)}</pre><pre class="fv-src"><code class="hljs language-${escapeHtml(lang)}">${hljsHighlight(fullText, lang)}</code></pre></div>`;
203
204
  } else {
204
- body = `<pre class="fv-plain"><code>${data.rows.map((r) => `<span class="ln"><span class="lnn">${r.n}</span><span class="lnc">${escapeHtml(r.t)}</span></span>`).join("")}</code></pre>`;
205
+ body = `<pre class="fv-plain"><code>${sorted.map((r) => `<span class="ln"><span class="lnn">${r.n}</span><span class="lnc">${escapeHtml(r.t)}</span></span>`).join("")}</code></pre>`;
205
206
  }
206
207
 
207
208
  return `<!doctype html>