diff --git a/src/components/Board.jsx b/src/components/Board.jsx index ba26c77..9ee9073 100644 --- a/src/components/Board.jsx +++ b/src/components/Board.jsx @@ -340,6 +340,11 @@ export default function Board(props) { const [cardNewForm, setCardNewForm] = useState([]) const [searchParams, setSearchParams] = useSearchParams() const shareParam = searchParams.get('share') + const formatAsBlockquote = (text) => { + if (!text) return ''; + return text.split('\n').map(line => `> ${line}`).join('\n'); + }; + const [shareText, setShareText] = useState( shareParam ? decodeURIComponent(shareParam) : '' ) @@ -348,7 +353,7 @@ export default function Board(props) { if(shareParam && !cardNewForm.includes(0)) { setCardNewForm([0]) } - setShareText(shareParam ? decodeURIComponent(shareParam) : '') + setShareText(shareParam ? formatAsBlockquote(decodeURIComponent(shareParam)) : '') }, [shareParam]) // Toggle by either adding the id if not there, or returning the array without it if present diff --git a/src/components/ShareTarget.jsx b/src/components/ShareTarget.jsx index 3fd0dc8..b6f8cee 100644 --- a/src/components/ShareTarget.jsx +++ b/src/components/ShareTarget.jsx @@ -16,7 +16,7 @@ export default function ShareTarget() { ]; const cardContent = fields .filter(([, value]) => value) - .map(([label, value]) => `> ${label}: ${value}`) + .map(([label, value]) => `${label}: ${value}`) .join('\n\n'); const payload = encodeURIComponent(cardContent); const boardId = localStorage.getItem("lastBoard") ?? store.boards[0]?.id;