Skip to content

Conversation

@liwenka1
Copy link

Fix: Correct text export path from './multi.mjs' to './text.mjs'

Description

This PR fixes an incorrect export statement in linkify.mjs where the text namespace was mistakenly exported from multi.mjs instead of text.mjs.

Problem

Line 218 in linkify.mjs contains an obvious error:

export * as text from './multi.mjs';  // ❌ Incorrect

This causes the text namespace to export the contents of the multi module instead of the text module, leading to:

  • Incorrect API behavior
  • Users unable to access text token identifiers defined in text.mjs (such as WORD, UWORD, LOCALHOST, TLD, SCHEME, etc.)
  • Confusion between the multi and text namespaces

Solution

Changed the export path to the correct module:

export * as text from './text.mjs';  // ✅ Correct

Changes

  • File: linkify.mjs
  • Line: 218
  • Change: Updated path from './multi.mjs' to './text.mjs'

Impact

After this fix:

  • The text namespace correctly exports content from text.mjs
  • The multi and text namespaces are now properly separated
  • Users can correctly access text token constants:
    import { text } from 'linkifyjs';
    console.log(text.WORD, text.TLD, text.LOCALHOST); // Works as expected

Testing

  • Verified the correct file path exists (text.mjs)
  • Confirmed the export statement syntax is correct
  • No other files are affected by this change

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.

1 participant