summaryrefslogtreecommitdiff
path: root/src/util/markdown.ts
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@hey.com>2023-10-06 16:25:29 +0100
committerRaphael Kabo <raphaelkabo@hey.com>2023-10-06 16:25:29 +0100
commit2996a4d05d0ea2f8446e2a2a0383979ceec748ae (patch)
treeaeab360ac4c1aa14f50b638f9b799dad8df55ff8 /src/util/markdown.ts
parent115210bfd9a5ae7bb8b516ce0d2cf3d9042dead7 (diff)
Run Prettier on all files
Diffstat (limited to 'src/util/markdown.ts')
-rw-r--r--src/util/markdown.ts66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/util/markdown.ts b/src/util/markdown.ts
index b1577d9..9f5d384 100644
--- a/src/util/markdown.ts
+++ b/src/util/markdown.ts
@@ -5,40 +5,40 @@ import { marked } from "marked";
// &#63; to ? helper
function htmlEscapeToText(text: string) {
- return text.replace(/\&\#[0-9]*;|&amp;/g, function (escapeCode) {
- if (escapeCode.match(/amp/)) {
- return "&";
- }
- const code = escapeCode.match(/[0-9]+/);
- return String.fromCharCode(Number(code));
- });
+ return text.replace(/\&\#[0-9]*;|&amp;/g, function (escapeCode) {
+ if (escapeCode.match(/amp/)) {
+ return "&";
+ }
+ const code = escapeCode.match(/[0-9]+/);
+ return String.fromCharCode(Number(code));
+ });
}
export const renderPlain = () => {
- var render = new marked.Renderer();
- // render just the text of a link, strong, em
- render.link = function (href, title, text) {
- return text;
- };
- render.strong = function (text) {
- return text;
- };
- render.em = function (text) {
- return text;
- };
- // render just the text of a paragraph
- render.paragraph = function (text) {
- return htmlEscapeToText(text) + "\r\n";
- };
- // render nothing for headings, images, and br
- render.heading = function (text, level) {
- return "";
- };
- render.image = function (href, title, text) {
- return "";
- };
- render.br = function () {
- return "";
- };
- return render;
+ var render = new marked.Renderer();
+ // render just the text of a link, strong, em
+ render.link = function (href, title, text) {
+ return text;
+ };
+ render.strong = function (text) {
+ return text;
+ };
+ render.em = function (text) {
+ return text;
+ };
+ // render just the text of a paragraph
+ render.paragraph = function (text) {
+ return htmlEscapeToText(text) + "\r\n";
+ };
+ // render nothing for headings, images, and br
+ render.heading = function (text, level) {
+ return "";
+ };
+ render.image = function (href, title, text) {
+ return "";
+ };
+ render.br = function () {
+ return "";
+ };
+ return render;
};