plebbit / plebbit-react

A GUI for plebbit
https://plebbitapp.eth.limo
GNU General Public License v2.0
35 stars 6 forks source link

Fix text editor #257

Closed estebanabaroa closed 1 year ago

estebanabaroa commented 1 year ago

https://plebbitapp.eth.limo/#/p/12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu/c/QmSEsdScR76G1rvo9hB94kQKNbftuwVM5CTwuGLnFeLDmb

Screenshot 2023-04-21 at 22-09-51 Is plebbit related to this NFT project They are both named pleb token  https __coinmarketcap com_currencies_plebtoken_

You can see the is part of the JSON, so the error isn't from parsing, but rather from the markdown editor: https://ipfs.io/ipfs/QmZtRVjrNPaSsHzkgehUQ332dVTY7NwUMD1WTiP9Ud5MvN

Screenshot 2023-04-21 at 22-15-30 https __ipfs io

We should only support markdown basic syntax, no HTML tags should be allowed at all https://www.markdownguide.org/basic-syntax/

The markdown editor must be edited to remove whatever part is adding the <span>

estebanabaroa commented 1 year ago

another issue with parsing is that we shouldn't allow image embeds like this post

https://ipfs.io/ipfs/QmR9j7X4ZnNmQU4N8K88jiJHjoTRjUkjYg3Qmr8dq7DksA

content: "\n![](https://i.kym-cdn.com/entries/icons/facebook/000/035/431/cover9.jpg)\n\n"

is not a link post, it's a content post that has a markdown image embedded. the markdown editor shouldn't allow embedding images, and the markdown parser shouldn't embed the images either.

This is what it looks like now:

https://plebbitapp.eth.limo/#/p/business-and-finance.eth/c/QmR9j7X4ZnNmQU4N8K88jiJHjoTRjUkjYg3Qmr8dq7DksA

Screenshot 2023-04-29 at 17-42-30 Plebbit

It's not a link post, it's a comment.content embed with markdown. There should be an option to disable embedding images in markdown-it I think.

  1. The markdown editor shouldn't allow adding image embeds
  2. The markdown parser shouldn't parse and embed the images