The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
fix(collab): preserve line breaks in notes display (#608)
Maurice149aa4c5e216
diff --git a/client/package-lock.json b/client/package-lock.jsonindex 75d589478..2722ac744 100644--- a/client/package-lock.json+++ b/client/package-lock.json@@ -21,6 +21,7 @@"react-markdown": "^10.1.0","react-router-dom": "^6.22.2","react-window": "^2.2.7",+ "remark-breaks": "^4.0.0","remark-gfm": "^4.0.1","topojson-client": "^3.1.0","zustand": "^4.5.2"@@ -7585,6 +7586,20 @@"url": "https://opencollective.com/unified"}},+ "node_modules/mdast-util-newline-to-break": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/mdast-util-newline-to-break/-/mdast-util-newline-to-break-2.0.0.tgz",+ "integrity": "sha512-MbgeFca0hLYIEx/2zGsszCSEJJ1JSCdiY5xQxRcLDDGa8EPvlLPupJ4DSajbMPAnC0je8jfb9TiUATnxxrHUog==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-find-and-replace": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },"node_modules/mdast-util-phrasing": {"version": "4.1.0","resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz",@@ -9272,6 +9287,21 @@"regjsparser": "bin/parser"}},+ "node_modules/remark-breaks": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/remark-breaks/-/remark-breaks-4.0.0.tgz",+ "integrity": "sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-newline-to-break": "^2.0.0",+ "unified": "^11.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },"node_modules/remark-gfm": {"version": "4.0.1","resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",diff --git a/client/package.json b/client/package.jsonindex e5d2c2767..ce178383e 100644--- a/client/package.json+++ b/client/package.json@@ -28,6 +28,7 @@"react-markdown": "^10.1.0","react-router-dom": "^6.22.2","react-window": "^2.2.7",+ "remark-breaks": "^4.0.0","remark-gfm": "^4.0.1","topojson-client": "^3.1.0","zustand": "^4.5.2"diff --git a/client/src/components/Collab/CollabNotes.tsx b/client/src/components/Collab/CollabNotes.tsxindex 66a4dbd79..2585cabfb 100644--- a/client/src/components/Collab/CollabNotes.tsx+++ b/client/src/components/Collab/CollabNotes.tsx@@ -3,6 +3,7 @@ import { useState, useEffect, useCallback, useRef, useMemo } from 'react'import DOM from 'react-dom'import Markdown from 'react-markdown'import remarkGfm from 'remark-gfm'+import remarkBreaks from 'remark-breaks'import { Plus, Trash2, Pin, PinOff, Pencil, X, Check, StickyNote, Settings, ExternalLink, Maximize2, Loader2 } from 'lucide-react'import { collabApi } from '../../api/client'import { getAuthUrl } from '../../api/authUrl'@@ -845,7 +846,7 @@ function NoteCard({ note, currentUser, canEdit, onUpdate, onDelete, onEdit, onVimaxHeight: '4.5em', overflow: 'hidden',wordBreak: 'break-word', fontFamily: FONT,}}>- <Markdown remarkPlugins={[remarkGfm]}>{note.content}</Markdown>+ <Markdown remarkPlugins={[remarkGfm, remarkBreaks]}>{note.content}</Markdown></div>)}</div>@@ -1352,7 +1353,7 @@ export default function CollabNotes({ tripId, currentUser }: CollabNotesProps) {</div></div><div className="collab-note-md-full" style={{ padding: '16px 20px', overflowY: 'auto', fontSize: 14, color: 'var(--text-primary)', lineHeight: 1.7 }}>- <Markdown remarkPlugins={[remarkGfm]}>{viewingNote.content || ''}</Markdown>+ <Markdown remarkPlugins={[remarkGfm, remarkBreaks]}>{viewingNote.content || ''}</Markdown>{(viewingNote.attachments || []).length > 0 && (<div style={{ marginTop: 16, paddingTop: 16, borderTop: '1px solid var(--border-primary)' }}><div style={{ fontSize: 11, fontWeight: 600, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: 0.5, marginBottom: 10 }}>{t('files.title')}</div>