MCPcopy Create free account
hub / github.com/hackmdio/codimd / slugifyWithUTF8

Function slugifyWithUTF8

public/js/extra.js:190–198  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

188}
189
190function slugifyWithUTF8 (text) {
191 // remove HTML tags and trim spaces
192 let newText = stripTags(text.toString().trim())
193 // replace space between words with dashes
194 newText = newText.replace(/\s+/g, '-')
195 // slugify string to make it valid as an attribute
196 newText = newText.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '')
197 return newText
198}
199
200// parse meta
201export function parseMeta (md, edit, view, toc, tocAffix) {

Callers 1

createHeaderIdFunction · 0.85

Calls 1

stripTagsFunction · 0.90

Tested by

no test coverage detected