Skip to content

Update the favorite name input in Add/Edit favorite panel#1663

Merged
alisa911 merged 16 commits intomainfrom
240426_1
Apr 28, 2026
Merged

Update the favorite name input in Add/Edit favorite panel#1663
alisa911 merged 16 commits intomainfrom
240426_1

Conversation

@alisa911
Copy link
Copy Markdown
Contributor

No description provided.

@alisa911
Copy link
Copy Markdown
Contributor Author

#543

@alisa911
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-04-28 at 15 30 23

Comment thread map/package.json Outdated
Comment thread map/src/frame/components/editor/Editor.jsx Outdated
Comment thread map/src/menu/search/explore/PhotosModal.jsx Outdated
Comment thread map/src/menu/search/explore/PhotosModal.jsx
Comment on lines +1 to +24
export function textToHTML(text) {
if (!text) return '';
if (text.trimStart().startsWith('<')) return text;

return text
.split('\n')
.map((line) => `<p>${line || '<br>'}</p>`)
.join('');
}

export function htmlToText(html) {
if (!html) return '';

return html
.replaceAll(/<\/p>/gi, '\n')
.replaceAll(/<br\s*\/?>/gi, '\n')
.replaceAll(/<[^>]+>/g, '')
.replace(/\n+$/, '')
.trim();
}

export function stripHtml(html) {
return htmlToText(html).replaceAll(/\s+/g, ' ').trim();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unworthy to place childish-like code in a separate module. Are you sure that this is enough to cover use cases?

@alisa911 alisa911 merged commit 5f33a23 into main Apr 28, 2026
@alisa911 alisa911 deleted the 240426_1 branch April 28, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants