MCPcopy
hub / github.com/truelockmc/streambert / renderChangelog

Function renderChangelog

src/components/UpdateModal.jsx:180–434  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

178// Handles: # headings, --- hr, > blockquote, 1. numbered list,
179// - /* bullets, ![img](url), blank lines, paragraphs
180function renderChangelog(text) {
181 if (!text) return null;
182 const lines = text.split("\n");
183 const elements = [];
184 let key = 0;
185
186 for (let i = 0; i < lines.length; i++) {
187 const line = lines[i];
188
189 // h3 ###
190 if (line.startsWith("### ")) {
191 elements.push(
192 <div
193 key={key++}
194 style={{
195 fontSize: 13,
196 fontWeight: 700,
197 color: "var(--text)",
198 marginTop: 14,
199 marginBottom: 4,
200 letterSpacing: 0.3,
201 }}
202 >
203 {inlineFormat(line.slice(4))}
204 </div>,
205 );
206 continue;
207 }
208
209 // h2 ##
210 if (line.startsWith("## ")) {
211 elements.push(
212 <div
213 key={key++}
214 style={{
215 fontSize: 14,
216 fontWeight: 700,
217 color: "var(--text)",
218 marginTop: 16,
219 marginBottom: 6,
220 borderBottom: "1px solid var(--border)",
221 paddingBottom: 4,
222 }}
223 >
224 {inlineFormat(line.slice(3))}
225 </div>,
226 );
227 continue;
228 }
229
230 // h1 #
231 if (line.startsWith("# ")) {
232 elements.push(
233 <div
234 key={key++}
235 style={{
236 fontSize: 15,
237 fontWeight: 700,

Callers 1

UpdateModalFunction · 0.85

Calls 1

inlineFormatFunction · 0.85

Tested by

no test coverage detected