File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
files := dist/index.html dist/main.css $(patsubst src/% .jinja2,dist/% ,$(wildcard src/posts/* .jinja2) )
2
2
3
3
all : $(files )
4
+ @echo $(files )
4
5
5
6
clean :
6
7
rm -rf $(files )
7
8
8
9
.PHONY : all clean
9
10
10
- dist/% : data.yaml src/ % .jinja2 src/base.html.jinja2 $( wildcard src/ % )
11
+ dist/% : FORCE
11
12
jinja2 $(patsubst dist/% ,src/% ,$@ ) .jinja2 data.yaml > $@
13
+
14
+ FORCE : ;
Original file line number Diff line number Diff line change 15
15
const input = document . getElementById ( 'input' ) ;
16
16
const output = document . getElementById ( 'output' ) ;
17
17
18
+ /**
19
+ * @param {string } data
20
+ */
18
21
function codeQuote ( data ) {
19
- return data . replace ( / (?< ! ` ) ( _ ? [ a - z A - Z 0 - 9 ( ) / \\ ] + ( _ | \( [ a - z A - Z 0 - 9 ( ) / \\ ] * \) | \- > ) [ a - z A - Z 0 - 9 ( ) / \\ ] * ) (? ! ` ) / g, '`$1`' ) ;
22
+ return data . split ( "\n" ) . map ( line => line . split ( " " ) . map ( word => {
23
+ if ( / ` / . test ( word ) ) {
24
+ return word ;
25
+ }
26
+
27
+ if ( ! / [ _ \- : = / \\ ] | .\( .* \) / . test ( word ) ) {
28
+ return word ;
29
+ }
30
+
31
+ return `\`${ word } \`` ;
32
+ } ) . join ( ' ' ) ) . join ( "\n" ) ;
20
33
}
21
34
22
35
const algos = {
You can’t perform that action at this time.
0 commit comments