-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add markdown support to blog body #49
base: main
Are you sure you want to change the base?
Conversation
@abhiandthetruth is attempting to deploy a commit to the gam1n Team on Vercel. A member of the Team first needs to authorize it. |
@@ -109,7 +111,7 @@ const BlogSection = ({ | |||
<span className="publisher-name">{fullName}</span> | |||
<ShareIcon onClick={() => copyToClipboard(id)} /> | |||
</UtilContainer> | |||
<p className="description">{description}</p> | |||
<ReactMarkdown className="description" remarkPlugins={[remarkGfm]}>{description}</ReactMarkdown> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can go with the route that allows us to render both normal content as well markdown content based on the type
of blog that's coming from the backend(here supabase). We'll need to introduce that type. Here we can just conditionals to check the type of the blog object. For testing and introducing the new column, I'll make the changes soon.
column will be body_content_format
: TEXT
or Markdown
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we have the blog type yet. But isn't markdown inclusive of the normal content?
Like normal content can be rendered by the react markdown tag? What exactly do you mean by normal content here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this is a separate feature. Should we track this on a separate issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Yes, that type I'll be adding tomorrow, though FE work can go in parallel if you want(since you make the schema change in your supabase DB).
-
Normal content means something that's not interpreted as a markdown syntax. Ability to add hyphens and hashtags without them being interpreted as markdown syntax.
-
We can create a separate issue. I'm not sure if we need but feel free to add any issues any time you think it's useful.
Issue related
What is being changed?
react-markdown
. Could have used theMarkdownPost
component but the naming suggests the use case is focussed on posts