Normalize hashtags to lowercase when publishing blog posts

Co-authored-by: mroxso <24775431+mroxso@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-17 20:37:27 +00:00
parent 7615fb31e7
commit 8d47aec411
2 changed files with 13 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ export function usePublishBlogPost() {
if (data.hashtags && data.hashtags.length > 0) {
data.hashtags.forEach(tag => {
tags.push(['t', tag]);
tags.push(['t', tag.toLowerCase()]);
});
}

View File

@@ -68,4 +68,16 @@ describe('detectSearchInputType', () => {
expect(result.type).toBe('hashtag');
expect(result.value).toBe('#bitcoin');
});
it('detects hashtags with capital letters', () => {
const result = detectSearchInputType('#BR');
expect(result.type).toBe('hashtag');
expect(result.value).toBe('#BR');
});
it('detects hashtags with mixed case', () => {
const result = detectSearchInputType('#Bitcoin');
expect(result.type).toBe('hashtag');
expect(result.value).toBe('#Bitcoin');
});
});