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

Invalid output for input. #11

Open
BlitzOffline opened this issue Apr 12, 2023 · 1 comment
Open

Invalid output for input. #11

BlitzOffline opened this issue Apr 12, 2023 · 1 comment

Comments

@BlitzOffline
Copy link
Contributor

For some reason the opening square bracket vanishes.

Input:
&8[#ff2609&lO#f53c1d&lw#ea5332&ln#e06946&le#d57f5a&lr&8]

Expected Output:
<dark_gray>[<#ff2609><bold>O</bold><#f53c1d><bold>w</bold><#ea5332><bold>n</bold><#e06946><bold>e</bold><#d57f5a><bold>r</bold><dark_gray>]

Actual Output:
<dark_gray><#ff2609><bold>O</bold><#f53c1d><bold>w</bold><#ea5332><bold>n</bold><#e06946><bold>e</bold><#d57f5a><bold>r</bold><dark_gray>]

@BlitzOffline
Copy link
Contributor Author

BlitzOffline commented Apr 12, 2023

Going to investigate this when I have time. Opened the issue so I remember what's going on.

Edit 1: Issue seems to be coming from the regex matching. I really don't like what I see here:

"&(?<code>[\\da-fk-or])|[&{\\[<]?[#x](?<hex>(&?[a-f\\d]){6})[}\\]>]?",

According to that regex, this is a valid hex color pattern: [#aaFF00>

I feel like we should split that into multiple patterns. Maybe this could lead to the ability to even customize the patterns people want supported and the ones they don't (talking just about the Kyorifier here, not the expansion).

Edit 2:
While this is a valid hex pattern: [#aaFF00>, turns out this is also a valid hex pattern: [#aaFF00 and the square bracket gets lost because of that.

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