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

Markdown: reference-style links broken across newline #8855

Closed
harding opened this issue Aug 4, 2021 · 3 comments · Fixed by #8966
Closed

Markdown: reference-style links broken across newline #8855

harding opened this issue Aug 4, 2021 · 3 comments · Fixed by #8966

Comments

@harding
Copy link

harding commented Aug 4, 2021

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes (this is the latest release).

Issue

Reference-style links broken across a newline are incorrectly rendered. For example, this text:

This is a [test][foo
bar] 1...2..3...

[foo bar]: /

Produces this output:

latest

CommonMark says it should render correctly: https://spec.commonmark.org/dingus/?text=This%20is%20a%20%5Btest%5D%5Bfoo%0Abar%5D%201...2..3...%0A%0A%5Bfoo%20bar%5D%3A%20%2F

Relevant config file:

[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      definitionList = true
      footnote = true
      linkify = true
      strikethrough = true
      table = true
      taskList = true
      typographer = true
    [markup.goldmark.parser]
      autoHeadingID = true
      autoHeadingIDType = "github"
      [markup.goldmark.parser.attribute]
        block = false
        title = true
    [markup.goldmark.renderer]
      hardWraps = false
      unsafe = true
      xhtml = false

(Thanks for all your work!)

@jmooring
Copy link
Member

jmooring commented Aug 4, 2021

Yes, your example should work per https://spec.commonmark.org/0.30/#example-540.

Please log an issue upstream (https://github.com/yuin/goldmark/issues) and link back to this issue. Thanks.

@yuin
Copy link

yuin commented Sep 12, 2021

goldmark author here, I've fixed the issue and released a new version.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants