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

Rules with a dot in them are ignored if a prior rule matches at least part of it #158

Open
5 tasks done
dbrasseur-aneo opened this issue Oct 17, 2023 · 0 comments
Open
5 tasks done

Comments

@dbrasseur-aneo
Copy link

Describe the bug

If you add rules as :

{
"abc" : "Abc",
"abc.def":"Abc.Def"
}

then

abc.def  
Abc.def
AbC.DeF
AbC

will match as :

AbC → Abc 
AbC → Abc  

but if you add them as :

{
"abc.def":"Abc.Def",
"abc" : "Abc"
}

then the same text

abc.def  
Abc.def
AbC.DeF
AbC

will match as :

Abc.def → Abc.Def 
AbC.DeF → Abc.Def  
AbC → Abc  

A fix could be to sort the keys by size (to have the "closest" match first)

Reproduction

https://stackblitz.com/edit/stackblitz-starters-zc8y2r?file=test.md

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
    Memory: 12.17 GB / 15.62 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
Binaries:
    Node: 16.20.1 - /usr/local/bin/node
    npm: 8.19.4 - /usr/local/bin/npm
    pnpm: 8.9.2 - /mnt/c/Dev/ArmoniK/ArmoniK.Community/node_modules/.bin/pnpm

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@dbrasseur-aneo dbrasseur-aneo changed the title Rules with a dot in them are ignored if a prior rule matches Rules with a dot in them are ignored if a prior rule matches at least part of it Oct 17, 2023
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

1 participant