Fix restricted map controls and release verification
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m17s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m17s
This commit is contained in:
@@ -21,13 +21,31 @@ function inline(text: string) {
|
||||
}
|
||||
|
||||
export function ReleaseNotes({ body }: { body: string }) {
|
||||
return body.split(/\r?\n\s*\r?\n/).map((block, i) => {
|
||||
const lines = block.split(/\r?\n/);
|
||||
if (lines.every((line) => /^\s*[-*]\s+/.test(line)))
|
||||
const blocks: { list: boolean; lines: string[] }[] = [];
|
||||
let current: (typeof blocks)[number] | undefined;
|
||||
for (const line of body.split(/\r?\n/)) {
|
||||
if (!line.trim()) {
|
||||
current = undefined;
|
||||
continue;
|
||||
}
|
||||
const bullet = /^\s*[-*]\s+(.+)$/.exec(line);
|
||||
if (!bullet && current?.list && /^\s{2,}\S/.test(line)) {
|
||||
current.lines[current.lines.length - 1] += ` ${line.trim()}`;
|
||||
continue;
|
||||
}
|
||||
const list = !!bullet;
|
||||
if (!current || current.list !== list) {
|
||||
current = { list, lines: [] };
|
||||
blocks.push(current);
|
||||
}
|
||||
current.lines.push(bullet ? bullet[1] : line);
|
||||
}
|
||||
return blocks.map(({ list, lines }, i) => {
|
||||
if (list)
|
||||
return (
|
||||
<ul key={i}>
|
||||
{lines.map((line, j) => (
|
||||
<li key={j}>{inline(line.replace(/^\s*[-*]\s+/, ""))}</li>
|
||||
<li key={j}>{inline(line)}</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user