Skip to content

Commit 182093a

Browse files
Merge pull request #19 from SimplrJS/dev
Version `1.0.7`.
2 parents f2925d3 + bd601ef commit 182093a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

__tests__/__snapshots__/markdown-generator.test.ts.snap

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__tests__/markdown-generator.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ describe("Escape string", () => {
469469
});
470470

471471
it("Escape symbols", () => {
472-
const textToEscape = "\ ` * _ { } [ ] ( ) # + - . ! |";
472+
const textToEscape = "\ ` * _ { } [ ] ( ) # + - . ! | < >";
473473
const result = MarkdownGenerator.EscapeString(textToEscape);
474474
expect(result).toMatchSnapshot();
475475
});
@@ -480,6 +480,7 @@ describe("Escape string", () => {
480480
["TValue", "string", "text"],
481481
["T", MarkdownGenerator.EscapeString("string | undefined"), "text"],
482482
["TKey ", "string", "text"],
483+
["TValue", MarkdownGenerator.EscapeString("Map<string>"), "text"]
483484
];
484485

485486
const result = MarkdownGenerator.Table(headers, rows);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@simplrjs/markdown",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Markdown generator",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/markdown-generator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ export namespace MarkdownGenerator {
238238
export function EscapeString(text: string): string {
239239
return text
240240
.replace(/[\\\`\*\_\{\}\[\]\(\)\#\+\-\.\!]/g, "\\$&")
241-
.replace(/\|/, "&#124;");
241+
.replace(/\|/, "&#124;")
242+
.replace(/\</, "&#60;")
243+
.replace(/\>/, "&#62;");
242244
}
243245
}

0 commit comments

Comments
 (0)