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

hostname is incorrect - it consumes too much #89

Open
Amzd opened this issue Jan 14, 2025 · 1 comment
Open

hostname is incorrect - it consumes too much #89

Amzd opened this issue Jan 14, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Amzd
Copy link

Amzd commented Jan 14, 2025

  • Steps to reproduce the problem:
  • Result with diff to what it should probably be (not sure about ascii_hostname):
[
    {
        "t": "LabeledLink",
        "c": {
            "label": [
                {
                    "t": "Text",
                    "c": "link"
                }
            ],
            "destination": {
                "target": "https://example.com",
-               "hostname": "example.com)thisshouldnotbeinthehostname",
+               "hostname": "example.com",
                "punycode": {
-                   "original_hostname": "example.com)thisshouldnotbeinthehostname",
+                   "original_hostname": "example.com",
-                   "ascii_hostname": "example.xn--com)thisshouldnotbeinthehostname-",
+                   "ascii_hostname": "example.com",
                    "punycode_encoded_url": "https://example.com"
                },
                "scheme": "https"
            }
        }
    },
    {
        "t": "Text",
        "c": "thisshouldnotbeinthehostname"
    }
@Simon-Laux
Copy link
Member

Simon-Laux commented Jan 14, 2025

version 0.8.0 didn't have this issue. So this seems to be since the refactoring to parse links according to spec.

-> maybe we need to do a 2 step process: find text with parenthesis rules (until closing parenthesis that was not opened or whitespace/linebreak) and then attempt to parse the result as link. since target is correct, we should probably just extract hostname from target to fix it

@Simon-Laux Simon-Laux added the bug Something isn't working label Jan 14, 2025
@Simon-Laux Simon-Laux changed the title hostname is incorrect hostname is incorrect - it consumes too much Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants