mirror of
https://github.com/outline/outline.git
synced 2026-02-24 13:29:53 -06:00
9 lines
287 B
JavaScript
9 lines
287 B
JavaScript
// @flow
|
|
import slugify from "slugify";
|
|
|
|
// Slugify, escape, and remove periods from headings so that they are
|
|
// compatible with url hashes AND dom selectors
|
|
export default function safeSlugify(text: string) {
|
|
return `h-${escape(slugify(text, { lower: true }).replace(".", "-"))}`;
|
|
}
|