luckyframework / luckyframework/lucky

HTML attributes that aren't pre-escaped?

Open
#1,823 8 comments 1 reaction 1 assignee View on GitHub

@mdwagner is already working on this.

Since Aug 28, 2023.

bug
Dominant language
Crystal
Stars
2.7k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

When using LuckyHTML, I've noticed you don't need to run HTML.escape, as it does this for you behind the scenes (#9). Normally, this would make sense to do on everything: both text and attributes.

However, if you're using something like htmx for your client-server interactions, there are situations where the attributes shouldn't be pre-escaped.

As an example, this
Screen Shot 2023-08-28 at 4 24 35 PM
becomes this
Screen Shot 2023-08-28 at 4 24 48 PM
which is undesirable (and broken).

We could provide a new tag method that will not escape attributes (you can already do unescaped text with the raw tag helper), but idk if anyone has any other ideas.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.