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

fix: Filter out markdown for og:description #6348

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

Jarsen136
Copy link
Contributor

@Jarsen136 Jarsen136 commented Jun 28, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

before:
image

after:

image

Did your issue had any of the "$" label on it?

Copilot Summary

🤖 Generated by Copilot at 93ebc72

Added a function to detect markdown in strings and used it to remove markdown from collection descriptions in meta tags. This improves SEO by providing cleaner and more relevant metadata for collections.

🤖 Generated by Copilot at 93ebc72

Sing, O Muse, of the skillful coder who devised
A cunning function, isMarkdownString, to discern
The subtle signs of links and styles that mark the words
Of sages who compose their wisdom in markdown.

@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 58c09f0
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/649d793aea65060008c378b0
😎 Deploy Preview https://deploy-preview-6348--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 28, 2023

AI-Generated Summary: This pull request includes changes in two files to filter out markdown from og:description. A new utility function isMarkdownString has been added in 'markdown.ts', which checks if a given text string is in markdown format. This utility function is utilized in 'CollectionBanner.vue' to check the linked collection's metadata description. If the description contains markdown, an empty string is returned; otherwise, the original description is preserved.

@reviewpad reviewpad bot added the small Pull request is small label Jun 28, 2023
@Jarsen136 Jarsen136 marked this pull request as ready for review June 28, 2023 14:26
@Jarsen136 Jarsen136 requested a review from a team as a code owner June 28, 2023 14:26
@Jarsen136 Jarsen136 requested review from vikiival and daiagi and removed request for a team June 28, 2023 14:26
@Jarsen136 Jarsen136 requested a review from prury June 28, 2023 15:30
@prury
Copy link
Member

prury commented Jun 28, 2023

I've tested on discord and telegram, works fine.
Only concern of my was users using markdown in their collection description, but i browsed trough some and couldn't find any.

@prury prury added the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Jun 28, 2023
@prury
Copy link
Member

prury commented Jun 28, 2023

is it supposed to work for the NFT inside the collection aswell?
image

@vikiival
Copy link
Member

Sir I think this is not correct. I guess @yangwao wanted to strip out markdown stuff like * [] #

@prury prury removed the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Jun 28, 2023
daiagi
daiagi previously approved these changes Jun 28, 2023
utils/markdown.ts Outdated Show resolved Hide resolved
utils/markdown.ts Show resolved Hide resolved
Co-authored-by: Luke Fishman <daiagi@gmail.com>
@codeclimate
Copy link

codeclimate bot commented Jun 29, 2023

Code Climate has analyzed commit 07f157a and detected 0 issues on this pull request.

View more on Code Climate.

@Jarsen136
Copy link
Contributor Author

✅ Updated

before
image

after

image

@Jarsen136
Copy link
Contributor Author

is it supposed to work for the NFT inside the collection aswell? image

Yes, it should also be the same now.

@prury
Copy link
Member

prury commented Jun 29, 2023

@Jarsen136 using a link that directs to the collection is still not showing the description without the markdown:

image

if i use the NFT inside the collection it works properly:

image

@prury prury added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Jun 29, 2023
@Jarsen136
Copy link
Contributor Author

Jarsen136 commented Jun 29, 2023

@Jarsen136 using a link that directs to the collection is still not showing the description without the markdown:

It should be related to the cache from discord. Pls use telegram to test the url sharing again. @prury

@prury
Copy link
Member

prury commented Jun 29, 2023

@Jarsen136 using a link that directs to the collection is still not showing the description without the markdown:

It should be related to the cache from discord. Pls use telegram to test the url sharing again. @prury

i had tested on telegram aswell:

image

might also be a cache problem, any other place where i can test it?

@Jarsen136
Copy link
Contributor Author

@Jarsen136 using a link that directs to the collection is still not showing the description without the markdown:

It should be related to the cache from discord. Pls use telegram to test the url sharing again. @prury

i had tested on telegram aswell:

might also be a cache problem, any other place where i can test it?

Yes. It's cache. You could test with this link to refresh the cache. https://deploy-preview-6348--koda-canary.netlify.app/stmn/collection/30?t=2

image

@prury
Copy link
Member

prury commented Jun 29, 2023

@Jarsen136 using a link that directs to the collection is still not showing the description without the markdown:

It should be related to the cache from discord. Pls use telegram to test the url sharing again. @prury

i had tested on telegram aswell:
might also be a cache problem, any other place where i can test it?

Yes. It's cache. You could test with this link to refresh the cache. https://deploy-preview-6348--koda-canary.netlify.app/stmn/collection/30?t=2
image

works fine ty, will just do a general check and i'll change the label

@vikiival vikiival merged commit 67c7ac9 into kodadot:main Jun 29, 2023
7 of 9 checks passed
@prury
Copy link
Member

prury commented Jun 29, 2023

oh, it got merged... 😄

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-changes-requested-🤞 PR is almost good to go, just some fine tunning small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter out markdown for og:description
4 participants