Functional TOC
This commit is contained in:
8
frontend/components/Editor/headingToSlug.js
Normal file
8
frontend/components/Editor/headingToSlug.js
Normal file
@ -0,0 +1,8 @@
|
||||
// @flow
|
||||
import { escape } from 'lodash';
|
||||
import slug from 'slug';
|
||||
|
||||
export default function headingToSlug(heading: string, title: string) {
|
||||
const level = heading.replace('heading', 'h');
|
||||
return escape(`${level}-${slug(title)}`);
|
||||
}
|
Reference in New Issue
Block a user