feat(post form): replace single return with double return on submit, because markdown is mandatory on plebbit, but a user from 4chan won't know that

This commit is contained in:
plebeius.eth
2024-05-07 22:23:49 +02:00
parent 5e8d7436f9
commit ccb75fcf3a
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -183,7 +183,8 @@ const PostFormTable = ({ closeForm }: { closeForm: () => void }) => {
wrap='soft'
ref={textRef}
onChange={(e) => {
isInPostPage ? setContent.content(e.target.value) : setSubmitStore({ content: e.target.value });
const content = e.target.value.replace(/\n/g, '\n\n');
isInPostPage ? setContent.content(content) : setSubmitStore({ content });
}}
/>
</td>
+4 -1
View File
@@ -95,7 +95,10 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => {
wrap='soft'
ref={textRef}
placeholder={_.capitalize(t('comment'))}
onChange={(e) => setContent.content(e.target.value)}
onChange={(e) => {
const content = e.target.value.replace(/\n/g, '\n\n');
setContent.content(content);
}}
autoFocus={!isMobile} // autofocus causes auto scroll to top on mobile
/>
</div>