v7.4.6
Patch Changes
-
a9e5276: Browsers assign element with
idto the global scope using the value as the variable name. E.g.:<h1 id="analytics">can be referenced viawindow.analytics.
This can be a problem when a name conflict happens. For instance, pages that expectanalytics.push()to be a function will stop working if the an element with anidofanalyticsexists in the page.In this change, we export the
slugifyfunction so that users can easily augment it.
This can be used to avoid variable name conflicts by giving the element a differentid.import { slugify } from 'markdown-to-jsx'; options={{ slugify: str => { let result = slugify(str) return result ? '-' + str : result; } }}