phpgt / phpgt/Dom

Preserve Alpine.js @click syntax

Open
#465 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
124
Forks
29
PR merge metrics
No merged PRs in 30d

Description

I use Alpine.js in my HTML and event could be short written with like this:

<button @click="open = true">Expand</button>

If I open a document with HTMLDocument, the output removes the @click attribute:

<button>Expand</button>

Any idea how I can preserve the @click attribute?

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.

Research direction

Start with the HTMLDocument behavior and reproduce the issue using the Alpine.js @click example from the report. Trace why the attribute is removed, and consider the issue complete when reopening the document preserves the @click attribute in the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, php
Domain
web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.