Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 5a49ddd

Browse files
authored
Refactor update line processing in certManager.js
1 parent ed21807 commit 5a49ddd

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

web/certManager.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,33 @@ function renderUpdates(md) {
178178
const after = md.substring(idx + "# Updates".length);
179179
const lines = after.split("\n");
180180
const updates = [];
181+
181182
for (let i = 0; i < lines.length; i++) {
182-
const line = lines[i].trim();
183+
let line = lines[i].trim();
184+
183185
if (!line) continue;
184186
if (line.startsWith("#")) break;
185-
// Accept lines starting with ** or plain lines
186-
const cleaned = line.replace(/\*\*/g, "").trim();
187-
if (cleaned) updates.push(cleaned);
187+
188+
// 🚫 ignore markdown dividers like ---
189+
if (line === "---") continue;
190+
191+
// strip bold markers
192+
line = line.replace(/\*\*/g, "").trim();
193+
194+
// only keep real update lines
195+
if (line.length > 2) {
196+
updates.push(line);
197+
}
188198
}
189199

190200
if (!updates.length) {
191201
container.innerHTML = `<div class="update-item">No updates found.</div>`;
192202
return;
193203
}
194204

195-
container.innerHTML = updates.map(u => `<div class="update-item">${escapeHtml(u)}</div>`).join("");
205+
container.innerHTML = updates
206+
.map(u => `<div class="update-item">${escapeHtml(u)}</div>`)
207+
.join("");
196208
}
197209

198210
/* ---------- Modal ---------- */

0 commit comments

Comments
 (0)