Duplicate attribute names change order when written to HTML

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

Nobody has claimed this yet.

Assessment

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

Research direction

Start in R/tags.R around line 1362, where duplicate attributes are ordered during HTML writing. Reproduce the two examples from the issue and verify that duplicate class attributes remain combined while the original attribute order is preserved; done means both outputs retain the input order.

Written by the indexing model from the issue text.

Description

For example

> div(id = "foo", class = "bar", class = "baz")
<div class="bar baz" id="foo"></div>
> tagAppendAttributes(div(id = "foo", class = "bar"), class = "baz")
<div class="bar baz" id="foo"></div>

This is a result of

https://github.com/rstudio/htmltools/blob/c237804eebcd1ead835cd62bcf1f26267fb03574/R/tags.R#L1362

(and maybe we just remove the sort()?)

Dominant language
R
Stars
225
Forks
73
PR merge metrics
No merged PRs in 30d

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.

More from rstudio/htmltools

All issues in rstudio/htmltools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.