Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abhiandthetruth
Copy link

Issue related

What is being changed?

  • Added markdown support to blog body using react-markdown. Could have used the MarkdownPost component but the naming suggests the use case is focussed on posts

@vercel
Copy link

vercel bot commented Oct 15, 2022

@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>
Copy link

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.

Copy link
Author

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?

Copy link
Author

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?

Copy link

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.

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.

Add capability to render markdown stored in DB
2 participants