File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
# Standard Library Cheatsheet
6
6
7
- Last updated: Mon, 30 Dec 2019 12:00:50 GMT
7
+ Last updated: Mon, 30 Dec 2019 12:04:13 GMT
8
8
9
9
10
10
## Usage
@@ -52,7 +52,7 @@ Last updated: Mon, 30 Dec 2019 12:00:50 GMT
52
52
| [ ` 右移 ` ] ( ../lib/js/位經.wy#L6 ) | ` x>>y ` |
53
53
| [ ` 補零右移 ` ] ( ../lib/js/位經.wy#L11 ) | ` x>>>y ` |
54
54
| [ ` 位与 ` ] ( ../lib/js/位經.wy#L16 ) | ` x&y ` |
55
- | [ ` 位或 ` ] ( ../lib/js/位經.wy#L21 ) | `x| y` |
55
+ | [ ` 位或 ` ] ( ../lib/js/位經.wy#L21 ) | ` x\ |y ` |
56
56
| [ ` 异或 ` ] ( ../lib/js/位經.wy#L26 ) | ` x^y ` |
57
57
| [ ` 与非 ` ] ( ../lib/js/位經.wy#L31 ) | ` ~(x&y) ` |
58
58
| [ ` 位變 ` ] ( ../lib/js/位經.wy#L36 ) | ` ~x ` |
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ to update the document.
44
44
Then you can submit a pull request. Thank you!
45
45
` ;
46
46
47
+ function escapeMarkdown ( text ) {
48
+ return text . replace ( / \| / g, "\\|" ) . replace ( / ` / g, "\\`" ) ;
49
+ }
50
+
47
51
function getLineIndexes ( text ) {
48
52
let previous = 0 ;
49
53
var lines = [ ] ;
@@ -88,7 +92,8 @@ function readFile(filepath, relativePath) {
88
92
markdown += `| Wenyan | Javascript Equivalent |\n|---|---|\n` ;
89
93
90
94
for ( const { wenyan, js, line } of results ) {
91
- markdown += `| [\`${ wenyan } \`](${ GithubPath } #L${ line + 1 } ) | \`${ js } \` |\n` ;
95
+ markdown += `| [\`${ escapeMarkdown ( wenyan ) } \`](${ GithubPath } #L${ line +
96
+ 1 } ) | \`${ escapeMarkdown ( js ) } \` |\n`;
92
97
}
93
98
94
99
return markdown + "\n" ;
You can’t perform that action at this time.
0 commit comments