You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/notify.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,7 @@ A more advanced escape function was required and has been developed with the fol
33
33
- Single and double quotes are escaped with a backslash (eg `'` becomes `\'` and `"` becomes `\"`), first escaping any backslashes that would be escape characters for the quotes.
34
34
- WARNING: Notify only supports up to 2 consecutive backslashes before quotes without formating issues and supporting that adds needless complexity.
35
35
- NOTE: When escaping the backslash in `\'` for Notify, it needs to be escaped with an additional two backslashes, because Notify treats `\\'` the same as `\'` which results in no backslash in the final output.
36
+
- A number followed by a period at the start of a line is escaped with a backslash (eg `1.` becomes `\1.`).
Copy file name to clipboardExpand all lines: src/lib/notify.js
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,8 @@ export function escapeFileLabel(str) {
63
63
64
64
/**
65
65
* Advanced escape function for Markdown content with the following rules:
66
-
* - A `-` or `*` or `#` character at the start of a line is escaped with a backslash.
66
+
* - A `-` or `*` or `#` character at the start of a line (ignoring leading whitespace) is escaped with a backslash.
67
+
* - A number immediately followed by a period at the start of a line (ignoring leading whitespace) has the period escaped with a backslash (e.g., `1.` becomes `1\.`).
67
68
* - Tab characters are replaced with 4 HTML encoded spaces (` `).
68
69
* - A `-` character surrounded by spaces or tabs has those spaces or tabs replaced with HTML encoded spaces (` `).
69
70
* - ``` being the only content on a single line is replaced with ` ` `
@@ -92,8 +93,14 @@ export function escapeContent(str) {
92
93
returnline.replace('```','` ` `')
93
94
}
94
95
95
-
// Rule: A `-` or `*` or `#` character at the start of a line is escaped with a backslash
0 commit comments