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

Improve README syntax highlight example #736

Merged
merged 1 commit into from
Apr 6, 2023
Merged

Conversation

dlqqq
Copy link
Contributor

@dlqqq dlqqq commented Apr 5, 2023

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

Improves README syntax highlighting example. The current example produces a TypeScript error by default. See here: react-syntax-highlighter/react-syntax-highlighter#479 (comment)

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Apr 5, 2023
@@ -354,14 +354,14 @@ ReactDom.render(
const match = /language-(\w+)/.exec(className || '')
return !inline && match ? (
<SyntaxHighlighter
{...props}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to not even pass spread props at all.

Anyway, I'm not necessarily against it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was something about SyntaxHighlighter passing all other props through on the div or so:

spread props pass arbitrary props to pre tag wrapping code.
https://github.com/react-syntax-highlighter/react-syntax-highlighter/tree/efc3f7b7537d1729193b7a472067bcbe6cbecaf1#props

Could be removed too, okay with me. But that can be a different PR!

/>
) : (
<code className={className} {...props}>
<code {...props} className={className}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order doesn't matter here.

Copy link
Member

@wooorm wooorm Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, but its not bad to be consistent with the other example!

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dlqqq!
I'd second @remcohaszing's suggestions.

@wooorm wooorm merged commit 9034dbd into remarkjs:main Apr 6, 2023
3 checks passed
@wooorm wooorm added 📚 area/docs This affects documentation 💪 phase/solved Post is done labels Apr 6, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Apr 6, 2023
diegohaz pushed a commit to ariakit/ariakit that referenced this pull request Apr 13, 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 |
|---|---|---|---|---|---|
| [react-markdown](https://togithub.com/remarkjs/react-markdown) |
[`8.0.6` ->
`8.0.7`](https://renovatebot.com/diffs/npm/react-markdown/8.0.6/8.0.7) |
[![age](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/compatibility-slim/8.0.6)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/confidence-slim/8.0.6)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>remarkjs/react-markdown</summary>

###
[`v8.0.7`](https://togithub.com/remarkjs/react-markdown/releases/tag/8.0.7)

[Compare
Source](https://togithub.com/remarkjs/react-markdown/compare/8.0.6...8.0.7)

##### Perf

-
[`c289176`](https://togithub.com/remarkjs/react-markdown/commit/c289176)
Fix performance for keys
by [@&#8203;wooorm](https://togithub.com/wooorm) in
[remarkjs/react-markdown#738

##### Docs

-
[`9034dbd`](https://togithub.com/remarkjs/react-markdown/commit/9034dbd)
Fix types in syntax highlight example
by [@&#8203;dlqqq](https://togithub.com/dlqqq) in
[remarkjs/react-markdown#736

**Full Changelog**:
remarkjs/react-markdown@8.0.6...8.0.7

</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://app.renovatebot.com/dashboard#github/ariakit/ariakit).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40MC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNDAuMCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
tompluess added a commit to tompluess/tompluess-gatsby that referenced this pull request Apr 14, 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 |
|---|---|---|---|---|---|
| [core-js](https://togithub.com/zloirock/core-js) | [`3.30.0` ->
`3.30.1`](https://renovatebot.com/diffs/npm/core-js/3.30.0/3.30.1) |
[![age](https://badges.renovateapi.com/packages/npm/core-js/3.30.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/core-js/3.30.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/core-js/3.30.1/compatibility-slim/3.30.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/core-js/3.30.1/confidence-slim/3.30.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [react-markdown](https://togithub.com/remarkjs/react-markdown) |
[`8.0.6` ->
`8.0.7`](https://renovatebot.com/diffs/npm/react-markdown/8.0.6/8.0.7) |
[![age](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/compatibility-slim/8.0.6)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/confidence-slim/8.0.6)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>zloirock/core-js</summary>

###
[`v3.30.1`](https://togithub.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#&#8203;3301---20230414-httpsgithubcomzloirockcore-jsreleasestagv3301)

[Compare
Source](https://togithub.com/zloirock/core-js/compare/v3.30.0...v3.30.1)

- Added a fix for a NodeJS 19.9.0 `URL.canParse`
[bug](https://togithub.com/nodejs/node/issues/47505)
-   Compat data improvements:
- [`JSON.parse` source text access
proposal](https://togithub.com/tc39/proposal-json-parse-with-source)
features marked as
[supported](https://chromestatus.com/feature/5121582673428480) from V8 ~
Chrome 114
- [`ArrayBuffer.prototype.transfer` and friends
proposal](https://togithub.com/tc39/proposal-arraybuffer-transfer)
features marked as
[supported](https://chromestatus.com/feature/5073244152922112) from V8 ~
Chrome 114
-
[`URLSearchParams.prototype.size`](https://togithub.com/whatwg/url/pull/734)
marked as supported from V8 ~ Chrome 113

</details>

<details>
<summary>remarkjs/react-markdown</summary>

###
[`v8.0.7`](https://togithub.com/remarkjs/react-markdown/releases/tag/8.0.7)

[Compare
Source](https://togithub.com/remarkjs/react-markdown/compare/8.0.6...8.0.7)

##### Perf

-
[`c289176`](https://togithub.com/remarkjs/react-markdown/commit/c289176)
Fix performance for keys
by [@&#8203;wooorm](https://togithub.com/wooorm) in
[remarkjs/react-markdown#738

##### Docs

-
[`9034dbd`](https://togithub.com/remarkjs/react-markdown/commit/9034dbd)
Fix types in syntax highlight example
by [@&#8203;dlqqq](https://togithub.com/dlqqq) in
[remarkjs/react-markdown#736

**Full Changelog**:
remarkjs/react-markdown@8.0.6...8.0.7

</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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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://app.renovatebot.com/dashboard#github/tompluess/tompluess).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40MC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNDAuMCJ9-->
renovate bot added a commit to Unleash/unleash that referenced this pull request Apr 22, 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 |
|---|---|---|---|---|---|
| [react-markdown](https://togithub.com/remarkjs/react-markdown) |
[`8.0.4` ->
`8.0.7`](https://renovatebot.com/diffs/npm/react-markdown/8.0.4/8.0.7) |
[![age](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/compatibility-slim/8.0.4)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/react-markdown/8.0.7/confidence-slim/8.0.4)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>remarkjs/react-markdown</summary>

###
[`v8.0.7`](https://togithub.com/remarkjs/react-markdown/releases/tag/8.0.7)

[Compare
Source](https://togithub.com/remarkjs/react-markdown/compare/8.0.6...8.0.7)

##### Perf

-
[`c289176`](https://togithub.com/remarkjs/react-markdown/commit/c289176)
Fix performance for keys
by [@&#8203;wooorm](https://togithub.com/wooorm) in
[remarkjs/react-markdown#738

##### Docs

-
[`9034dbd`](https://togithub.com/remarkjs/react-markdown/commit/9034dbd)
Fix types in syntax highlight example
by [@&#8203;dlqqq](https://togithub.com/dlqqq) in
[remarkjs/react-markdown#736

**Full Changelog**:
remarkjs/react-markdown@8.0.6...8.0.7

###
[`v8.0.6`](https://togithub.com/remarkjs/react-markdown/blob/HEAD/changelog.md#&#8203;806---2023-03-20)

[Compare
Source](https://togithub.com/remarkjs/react-markdown/compare/8.0.5...8.0.6)

-
[`33ab015`](https://togithub.com/remarkjs/react-markdown/commit/33ab015)
    Update to TS 5\
    by [**@&#8203;Methuselah96**](https://togithub.com/Methuselah96)
in
[#&#8203;734](https://togithub.com/remarkjs/react-markdown/issues/734)

###
[`v8.0.5`](https://togithub.com/remarkjs/react-markdown/blob/HEAD/changelog.md#&#8203;805---2023-01-17)

[Compare
Source](https://togithub.com/remarkjs/react-markdown/compare/8.0.4...8.0.5)

-
[`d640d40`](https://togithub.com/remarkjs/react-markdown/commit/d640d40)
    Update to use `node16` module resolution in `tsconfig.json`\
by [**@&#8203;ChristianMurphy**](https://togithub.com/ChristianMurphy)
in [#&#8203;723](https://togithub.com/remarkjs/react-markdown/pull/723)
-
[`402fea3`](https://togithub.com/remarkjs/react-markdown/commit/402fea3)
    Fix typo in `plugins` deprecation message\
    by [**@&#8203;marc2332**](https://togithub.com/marc2332)
in [#&#8203;719](https://togithub.com/remarkjs/react-markdown/pull/719)
-
[`4f98f73`](https://togithub.com/remarkjs/react-markdown/commit/4f98f73)
    Remove deprecated and unneeded `defaultProps`\
    by [**@&#8203;Lepozepo**](https://togithub.com/Lepozepo)
in [#&#8203;718](https://togithub.com/remarkjs/react-markdown/pull/718)

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **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://app.renovatebot.com/dashboard#github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTYuMCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 area/docs This affects documentation 💪 phase/solved Post is done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants