You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
draw-a-ui/app/lib/htmlify.ts

11 lines
267 B
TypeScript

export function htmlify(text: string) {
const message = text
const start = message.indexOf('<!DOCTYPE html>')
const end = message.indexOf('</html>')
if (end > 0) {
return message.slice(start, end + '</html>'.length)
} else {
return message.slice(start)
}
}