Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/Board.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) : ''
)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShareTarget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down