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

(image:) escape alt text for smartypants #6355

Closed

Conversation

distantnative
Copy link
Member

This PR …

Fixes

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Mar 23, 2024
@distantnative distantnative added this to the 4.2.0 milestone Mar 23, 2024
@distantnative distantnative requested a review from a team March 23, 2024 15:08
@distantnative distantnative self-assigned this Mar 23, 2024
@distantnative distantnative linked an issue Mar 23, 2024 that may be closed by this pull request
Copy link
Member

@lukasbestle lukasbestle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much looks like a hack to me TBH. Html::img() (or to be more specific, Xml::attr()) already uses Xml::encode() to make the value string safe. We should investigate why that doesn't bring the intended effect.

@distantnative
Copy link
Member Author

@lukasbestle You're right, I think the problem starts because smartypants is applied after resolving all kirbytags https://github.com/getkirby/kirby/blob/main/src/Cms/App.php#L872-L874 - so actually applied on the HTML.

The SmartyPants library seems like it should actually respect HTML code and not create problems. But my guess is that something there fails.

@distantnative distantnative marked this pull request as draft March 24, 2024 17:46
@bastianallgeier bastianallgeier modified the milestones: 4.2.0, 4.2.x Mar 27, 2024
@distantnative
Copy link
Member Author

Closing this for now as the proposed solution isn't quite right.

@distantnative distantnative deleted the fix/6344-image-tag-alt-smartypants branch April 25, 2024 09:02
@distantnative distantnative removed this from the 4.2.x milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image tag breaks with smartypants enabled
3 participants