* ensure that eslint runs on all frontend code * remove tslint from `design-system` * enable prettier and eslint-prettier for `design-system` * Delete tslint.json * use a single editorconfig for the repo * enable prettier for all code in `design-system` * more linting fixes on design-system * ignore coverage for git and prettier * lintfix on editor-ui
14 lines
363 B
TypeScript
14 lines
363 B
TypeScript
export const escapeMarkdown = (html: string | undefined): string => {
|
|
if (!html) {
|
|
return '';
|
|
}
|
|
const escaped = html.replace(/</g, '<').replace(/>/g, '>');
|
|
|
|
// unescape greater than quotes at start of line
|
|
const withQuotes = escaped.replace(/^((\s)*(>)+)+\s*/gm, (matches) => {
|
|
return matches.replace(/>/g, '>');
|
|
});
|
|
|
|
return withQuotes;
|
|
};
|