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

fix(compiler-solid): Props replacement not working with multiline starttags #301

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

NathanHuisman
Copy link
Contributor

Description

Props replacement wasn't working because the lookbehind only included the symbol '.', which doesn't match newlines.

According to the XML spec, newlines can be included in the spacing in a starttag.

This was a very quick fix, so I figured I did not need to create an issue

Input:

<svg
  width="35"
  height="44"
  viewBox="0 0 35 44"
  fill="currentColor"
  xmlns="http://www.w3.org/2000/svg"
  role="presentation"
>
<!-- (left out, irrelevant) -->
</svg>

Output before fix:

export default (props = {}) => <svg
  width="35"
  height="44"
  viewBox="0 0 35 44"
  fill="currentColor"
  xmlns="http://www.w3.org/2000/svg"
  role="presentation"
>
{/* (left out, irrelevant) */}
</svg>

Output after fix:

export default (props = {}) => <svg
  width="35"
  height="44"
  viewBox="0 0 35 44"
  fill="currentColor"
  xmlns="http://www.w3.org/2000/svg"
  role="presentation"
{...props}>
{/* (left out, irrelevant) */}
</svg>

… starttags

Props replacement wasn't working because the lookbehind only included the symbol '.', which doesn't match newlines.

According to [the spec](https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-starttags), newlines can be included in the spacing in a starttag
@antfu antfu merged commit 5668fbb into unplugin:main Aug 28, 2023
qwerty287 added a commit to woodpecker-ci/woodpecker that referenced this pull request Sep 8, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unplugin-icons](https://togithub.com/antfu/unplugin-icons) |
[`^0.16.3` ->
`^0.17.0`](https://renovatebot.com/diffs/npm/unplugin-icons/0.16.3/0.17.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/unplugin-icons/0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unplugin-icons/0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unplugin-icons/0.16.3/0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unplugin-icons/0.16.3/0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>antfu/unplugin-icons (unplugin-icons)</summary>

###
[`v0.17.0`](https://togithub.com/unplugin/unplugin-icons/releases/tag/v0.17.0)

[Compare
Source](https://togithub.com/antfu/unplugin-icons/compare/v0.16.6...v0.17.0)

#####    🚨 Breaking Changes

- Add support for Svelte 4  -  by
[@&#8203;userquin](https://togithub.com/userquin) in
[unplugin/unplugin-icons#297
[<samp>(263a9)</samp>](https://togithub.com/unplugin/unplugin-icons/commit/263a9ef)

#####     [View changes on
GitHub](https://togithub.com/unplugin/unplugin-icons/compare/v0.16.6...v0.17.0)

###
[`v0.16.6`](https://togithub.com/unplugin/unplugin-icons/releases/tag/v0.16.6)

[Compare
Source](https://togithub.com/antfu/unplugin-icons/compare/v0.16.5...v0.16.6)

#####    🐞 Bug Fixes

- **compiler-solid**: Props replacement not working with multiline
starttags  -  by
[@&#8203;NathanHuisman](https://togithub.com/NathanHuisman) in
[unplugin/unplugin-icons#301
[<samp>(5668f)</samp>](https://togithub.com/antfu/unplugin-icons/commit/5668fbb)
- **types**: Fix type errors  -  by
[@&#8203;zyyv](https://togithub.com/zyyv) in
[unplugin/unplugin-icons#299
[<samp>(79412)</samp>](https://togithub.com/antfu/unplugin-icons/commit/7941238)

#####     [View changes on
GitHub](https://togithub.com/antfu/unplugin-icons/compare/v0.16.5...v0.16.6)

###
[`v0.16.5`](https://togithub.com/unplugin/unplugin-icons/releases/tag/v0.16.5)

[Compare
Source](https://togithub.com/antfu/unplugin-icons/compare/v0.16.4...v0.16.5)

#####    🐞 Bug Fixes

- Explicit .cjs and .mjs extension  -  by
[@&#8203;antfu](https://togithub.com/antfu)
[<samp>(45bc0)</samp>](https://togithub.com/antfu/unplugin-icons/commit/45bc00d)

#####     [View changes on
GitHub](https://togithub.com/antfu/unplugin-icons/compare/v0.16.4...v0.16.5)

###
[`v0.16.4`](https://togithub.com/unplugin/unplugin-icons/releases/tag/v0.16.4)

[Compare
Source](https://togithub.com/antfu/unplugin-icons/compare/v0.16.3...v0.16.4)

#####    🐞 Bug Fixes

- Update qwik support  -  by
[@&#8203;michaelhthomas](https://togithub.com/michaelhthomas) in
[unplugin/unplugin-icons#291
[<samp>(d3a85)</samp>](https://togithub.com/antfu/unplugin-icons/commit/d3a852f)

#####     [View changes on
GitHub](https://togithub.com/antfu/unplugin-icons/compare/v0.16.3...v0.16.4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/woodpecker-ci/woodpecker).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants