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 hashtag plugin: add support for full width middle dot #492

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

yuiseki
Copy link
Contributor

@yuiseki yuiseki commented Oct 21, 2024

Nice to meet you, Thank you for the great OSS you are providing!
I love to using this OSS!

There is one problem in hashtag plugin with Japanese that I would like to fix, and I am sending this pull request.

Issue

  • linkifyjs hashtag plugin cannot parse full width middle dot correctly
  • Full width middle dot is a very important symbol in Japanese
    • That is used in many cases in Japanese
      • Name of person
      • Title of the work
      • Name of a sports team
      • Name of brand
  • X (formerly Twitter) supports full width middle dot in hashtags

Examples

  • #アラン・チューリング
    • Alan Mathison Turing
  • #スター・ウォーズ
    • STAR WARS
  • #レアル・マドリード
    • Real Madrid CF
  • #コカ・コーラ
    • coca cola

How to fix

  • I've added FULLWIDTHMIDDLEDOT to
    • packages/linkifyjs/src/text.js
    • packages/linkifyjs/src/scanner.js
  • I've updated packages/linkify-plugin-hashtag/src/hashtag.js
  • I've added test cases to
    • test/spec/linkifyjs/scanner.test.js
    • test/spec/linkify-plugin-hashtag.test.js

What I've checked

  • npm run build
  • npm run lint
  • npm run test

I would be very grateful if this issue could be fixed.
I would appreciate your consideration of merge this pull request.

Copy link
Owner

@nfrasser nfrasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yuiseki, this looks great, thank you very much for your contribution!

@nfrasser nfrasser merged commit e4b161a into nfrasser:main Oct 25, 2024
5 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11434698969

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 95.925%

Totals Coverage Status
Change from base Build 6952525806: 0.01%
Covered Lines: 1097
Relevant Lines: 1118

💛 - Coveralls

@yuiseki yuiseki deleted the hashtag-full-width-middle-dot branch October 26, 2024 11:07
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.

3 participants