feat: add game server infrastructure and documentary improvements
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
- Add Docker Compose for OpenFusion (FusionFall), MapleStory 2, and Minecraft FTB Infinity Evolved game servers - Add MapleStory 2 multi-service compose (MySQL, World, Login, Web, Game) - Add OpenFusion Dockerfile and configuration files - Fix CMS Dockerfile, web Dockerfile, and documentary components - Add root layout, globals.css, not-found page, and text formatting utils - Update .gitignore to exclude large game server repos and data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
18
apps/web/src/lib/format.ts
Normal file
18
apps/web/src/lib/format.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Converts plain text with newline separators into HTML paragraphs.
|
||||
* If the text already contains HTML block elements, returns as-is.
|
||||
*/
|
||||
export function formatTextToHtml(text: string): string {
|
||||
if (!text) return "";
|
||||
|
||||
// If already contains HTML block elements, return as-is
|
||||
if (/<(?:p|div|h[1-6]|ul|ol|blockquote)\b/i.test(text)) {
|
||||
return text;
|
||||
}
|
||||
|
||||
return text
|
||||
.split(/\n\n+/)
|
||||
.filter((p) => p.trim())
|
||||
.map((p) => `<p>${p.trim().replace(/\n/g, "<br>")}</p>`)
|
||||
.join("");
|
||||
}
|
||||
Reference in New Issue
Block a user