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

Linkify extension doesn't match hosts that start with single-letter domain label #190

Closed
3 tasks done
moorereason opened this issue Jan 30, 2021 · 1 comment · Fixed by #191
Closed
3 tasks done

Comments

@moorereason
Copy link
Contributor

Google's g.page hostname is not being matched by the Linkify extension.

Example rendering by Github in this issue editor: https://g.page/foo

Originally reported by a Hugo user, but this is an issue with goldmark.

Questionaire:

  • goldmark is fully compliant with the CommonMark. Before submitting issue, you must read CommonMark spec and confirm your output is different from CommonMark online demo.
    • Extensions(Autolink without < >, Table, etc) are not part of CommonMark spec. You should confirm your output is different from other official renderers correspond with an extension.
  • goldmark is not dedicated for Hugo. If you are Hugo user and your issue was raised by your experience in Hugo, you should consider create issue at Hugo repository at first .

1. What version of goldmark are you using? :

master (c4b3054)

2. What version of Go are you using? :

go1.16rc1

3. What operating system and processor architecture are you using? :

linux/amd64

4. What did you do? :

diff --git a/extension/_test/linkify.txt b/extension/_test/linkify.txt
index d619a8b..134f52b 100644
--- a/extension/_test/linkify.txt
+++ b/extension/_test/linkify.txt
@@ -169,3 +169,11 @@ http://server.intranet.acme.com:1313
 //- - - - - - - - -//
 <p><a href="http://server.intranet.acme.com:1313">http://server.intranet.acme.com:1313</a></p>
 //= = = = = = = = = = = = = = = = = = = = = = = =//
+
+
+17
+//- - - - - - - - -//
+https://g.page/foo
+//- - - - - - - - -//
+<p><a href="https://g.page/foo">https://g.page/foo</a></p>
+//= = = = = = = = = = = = = = = = = = = = = = = =//

5. What did you expect to see? :

passing test

6. What did you see instead? :

--- FAIL: TestLinkify (0.00s)
    testutil.go:176: ============= case 17 ================
        Markdown:
        -----------
        https://g.page/foo

        Expected:
        ----------
        <p><a href="https://g.page/foo">https://g.page/foo</a></p>

        Actual
        ---------
        <p>https://g.page/foo</p>

7. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?:

Linkify extension not part of CommonMark spec.

@cmosetick
Copy link

cmosetick commented Feb 5, 2021

@moorereason Thank you for chasing this rendering issue to Linkify extension!
I guessed a while back that goldmark was the source of the single character TLD issue, but was not able to find the actual source at the time. So I just created the issue in the hugo issue tracker as a starting point.

I honestly was not sure if it was a single character TLD issue, or an issue with .page TLD.
Nice find!

@yuin yuin closed this as completed in #191 Feb 7, 2021
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 a pull request may close this issue.

2 participants