hedgedoc/src/components/markdown-renderer/regex-plugins/replace-legacy-vimeo-short-code.ts
mrdrogdrog 0e912d64dd
Rename codimd to hedgedoc (#434)
Rename codimd to hedgedoc
2020-09-02 21:17:26 +02:00

11 lines
424 B
TypeScript

import { RegexOptions } from '../../../external-types/markdown-it-regex/interface'
export const replaceLegacyVimeoShortCode: RegexOptions = {
name: 'legacy-vimeo-short-code',
regex: /^{%vimeo ([\d]{6,11}) ?%}$/,
replace: (match) => {
// ESLint wants to collapse this tag, but then the tag won't be valid html anymore.
// noinspection CheckTagEmptyBody
return `<app-vimeo id="${match}"></app-vimeo>`
}
}