Files
outline/frontend/components/Editor/headingToSlug.js
2017-10-15 19:21:47 -07:00

9 lines
235 B
JavaScript

// @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)}`);
}