lift / lift/framework

Can't remove only class when class merging disabled

Open
#1,381 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CSS Selector Transforms P:Normal
Dominant language
Scala
Stars
1.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

As [discussed on the mailing list](https://groups.google.com/d/topic/liftweb/qN4VThXAsXw/discussion):

Using Lift 2.5-M3, with the example from issue #1312, the following code removes the "removeme" class, as expected:

```
(".removeme !!" #> ("td [class!]" #> "removeme")).apply(Hi)
```

Produces:

```
NodeSeq(Hi)
```

However, if the "removeme" class is the only class, it is not removed:

```
(".removeme !!" #> ("td [class!]" #> "removeme")).apply(Hi)
```

Produces:

```
NodeSeq(Hi)
```

The consensus seems to be that this is a bug.

Thanks,
Kevin

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 by reproducing the two Lift selector examples in the issue, comparing removal when the td has multiple classes versus only "removeme". Locate the implementation behind the "td [class!]" transformation and add a regression test showing that the sole class is removed, then verify the output no longer contains the class attribute or value.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.