diff --git a/.changeset/tall-crabs-flow.md b/.changeset/tall-crabs-flow.md deleted file mode 100644 index 8ea7184f..00000000 --- a/.changeset/tall-crabs-flow.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -"markdown-to-jsx": patch ---- - -Browsers assign element with `id` to the global scope using the value as the variable name. E.g.: `

` can be referenced via `window.analytics`. -This can be a problem when a name conflict happens. For instance, pages that expect `analytics.push()` to be a function will stop working if the an element with an `id` of `analytics` exists in the page. - -In this change, we export the `slugify` function so that users can easily augment it. -This can be used to avoid variable name conflicts by giving the element a different `id`. - -```js -import { slugify } from 'markdown-to-jsx'; - -options={{ - slugify: str => { - let result = slugify(str) - - return result ? '-' + str : result; - } -}} -``` diff --git a/.yarn/cache/@esbuild-linux-x64-npm-0.19.11-2afe281ab0-10.zip b/.yarn/cache/@esbuild-linux-x64-npm-0.19.11-2afe281ab0-10.zip new file mode 100644 index 00000000..1937416d Binary files /dev/null and b/.yarn/cache/@esbuild-linux-x64-npm-0.19.11-2afe281ab0-10.zip differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 87a0ed65..5c92d400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # markdown-to-jsx +## 7.4.6 + +### Patch Changes + +- a9e5276: Browsers assign element with `id` to the global scope using the value as the variable name. E.g.: `

` can be referenced via `window.analytics`. + This can be a problem when a name conflict happens. For instance, pages that expect `analytics.push()` to be a function will stop working if the an element with an `id` of `analytics` exists in the page. + + In this change, we export the `slugify` function so that users can easily augment it. + This can be used to avoid variable name conflicts by giving the element a different `id`. + + ```js + import { slugify } from 'markdown-to-jsx'; + + options={{ + slugify: str => { + let result = slugify(str) + + return result ? '-' + str : result; + } + }} + ``` + ## 7.4.5 ### Patch Changes diff --git a/package.json b/package.json index cf682461..67fdf5bd 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Convert markdown to JSX with ease for React and React-like projects. Super lightweight and highly configurable.", "homepage": "https://markdown-to-jsx.quantizor.dev", "license": "MIT", - "version": "7.4.5", + "version": "7.4.6", "publishConfig": { "access": "public" },