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

The shortname of Disqus could contain dash character. #1751

Open
Hsins opened this issue Mar 3, 2022 · 2 comments
Open

The shortname of Disqus could contain dash character. #1751

Hsins opened this issue Mar 3, 2022 · 2 comments

Comments

@Hsins
Copy link

Hsins commented Mar 3, 2022

As shown in the figure screenshot from Create a New Site Page on the right-hand side.

The unique Disqus URL could be combined of :

  • Lowercase Letters: abcdefghijklmnopqrstuvwxyz
  • Numbers: 0123456789
  • Dash: -

CodiMD handles the Disqus section in the disqus.ejs. But it doesn't work for shortnames containing dash character, and it doesn't handle shortnames with uppercase letters currently.

It would be better to modify it as following code:

- s.src = 'https://<%= disqus.replace(/[^A-Za-z0-9]+/g, '') %>.disqus.com/embed.js';
+ s.src = 'https://<%= disqus.toLowerCase().replace(/[^a-z0-9-]+/g, '') %>.disqus.com/embed.js';
@Hsins
Copy link
Author

Hsins commented Mar 3, 2022

PR #1750 is dealing with this issue.

@jackycute
Copy link
Member

jackycute commented Jan 13, 2023

Hi @Hsins,
Thanks for the help!
Could you open a PR for this modification? We like to merge this fix which also convert to lowercase before regex replace.

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

No branches or pull requests

2 participants