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

Softbreaks in image's alt text are eaten #416

Closed
yihui opened this issue Sep 21, 2023 · 1 comment
Closed

Softbreaks in image's alt text are eaten #416

yihui opened this issue Sep 21, 2023 · 1 comment

Comments

@yihui
Copy link

yihui commented Sep 21, 2023

  1. What version of goldmark are you using?

    1.5.6

  2. What version of Go are you using?

    1.20

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

    macOS 12.6.9 (Intel x86_64)

  4. What did you do?

    Convert this to HTML:

    ![alt
    text](logo.png)
  5. What did you expect to see? :

    <img src="logo.png" alt="alt
    text" />

    or even better:

    <img src="logo.png" alt="alt text" />
  6. What did you see instead?

    <img src="logo.png" alt="alttext" />

    Note that the line break was simply eaten, and the two words ended up being merged into one.

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

    Yes, CommonMark's online demo would output

    <img src="logo.png" alt="alt
    text" />

    Not ideal, but better than no spaces or breaks at all.

Thanks for the great project!

yihui added a commit to yihui/yihui.org that referenced this issue Sep 26, 2023
RStudio's visual editor also wraps alt text when wrapping other text (it probably should not), and goldmark simply eats softbreaks: yuin/goldmark#416 which leads to incorrect alt text
@yuin yuin closed this as completed in 6442ae1 Oct 14, 2023
@yihui
Copy link
Author

yihui commented Oct 14, 2023

Awesome. Thanks @yuin!

persuader72 pushed a commit to persuader72/goldmark that referenced this issue Apr 19, 2024
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