@kobalab/liulian 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### v1.1.6 / 2022-12-08
2
+
3
+ - highlight() の deprecated な呼び出し方法を修正
4
+ - 脆弱性警告に対処(qs 6.7.0 → 6.11.0)
5
+ - パッケージを最新化
6
+ - express 4.17.1 → 4.18.2
7
+ - express-session 1.17.1 → 1.17.3
8
+ - highlight.js 10.4.1 → 10.7.3
9
+ - mime 2.4.6 → 2.6.0
10
+ - session-file-store 1.4.0 → 1.5.0
11
+ - yargs 15.4.1 → 17.6.2
12
+
13
+ ### v1.1.5 / 2022-10-25
14
+
15
+ - #8 整形済みテキスト内などで不必要な行連結を行なっているバグを修正
16
+ - 脆弱性警告に対応(minimatch 3.0.4 → 3.1.2)
17
+
1
18
  ### v1.1.4 / 2022-09-11
2
19
 
3
20
  - size モジュールをブロックでも使えるよう修正
@@ -28,10 +28,7 @@ class LiuLian {
28
28
  insertText(text, head) {
29
29
  let lines = [];
30
30
  for (let line of text.replace(/\r?\n$/,'').split(/\r?\n/)) {
31
- if (lines.length && lines[lines.length - 1].substr(-1) == '\\')
32
- lines[lines.length - 1]
33
- = lines[lines.length - 1].replace(/\\$/,'') + line;
34
- else lines.push(line);
31
+ lines.push(line);
35
32
  }
36
33
  if (head) this._lines = lines.concat(this._lines);
37
34
  else this._lines = this._lines.concat(lines);
@@ -50,8 +47,27 @@ class LiuLian {
50
47
  }
51
48
  }
52
49
 
53
- readline() { return ! this.eod && this._lines.shift() }
54
- nextline() { return ! this.eod && this._lines[0] }
50
+ nextline(npb) {
51
+ if (this.eod) return;
52
+ if (npb) return this._lines[0];
53
+ let line = '';
54
+ for (let l of this._lines) {
55
+ line += l;
56
+ if (line.substr(-1) != '\\') break;
57
+ line = line.replace(/\\$/,'');
58
+ }
59
+ return line;
60
+ }
61
+ readline(npb) {
62
+ if (this.eod) return;
63
+ if (npb) return this._lines.shift();
64
+ let line = this._lines.shift();
65
+ while (line.substr(-1) == '\\') {
66
+ line = line.replace(/\\$/,'');
67
+ line += this._lines.shift();
68
+ }
69
+ return line;
70
+ }
55
71
 
56
72
  get(key) { return this._[key] }
57
73
  noteref(note) {
@@ -73,7 +89,7 @@ class LiuLian {
73
89
  this.eod = eod;
74
90
  let text = '';
75
91
  while (! this.eod) {
76
- let line = this.readline();
92
+ let line = this.readline(1);
77
93
  text += line + '\n';
78
94
  }
79
95
  this.reset(eod);
@@ -292,9 +308,9 @@ class LiuLian {
292
308
  pre() {
293
309
  let html = '<pre>';
294
310
  for (;;) {
295
- html += cdata(this.readline().replace(/^\ /,'')) + '\n';
311
+ html += cdata(this.readline(1).replace(/^\ /,'')) + '\n';
296
312
 
297
- let line = this.nextline();
313
+ let line = this.nextline(1);
298
314
  if (! line || ! line.match(/^\s/)) break;
299
315
  }
300
316
  return html.replace(/\n$/,'') + '</pre>\n\n';
@@ -308,7 +324,7 @@ class LiuLian {
308
324
  if (lang) {
309
325
  try {
310
326
  html += '<code>'
311
- + hljs.highlight(lang, code).value
327
+ + hljs.highlight(code, { language: lang }).value
312
328
  + '</code>'
313
329
  }
314
330
  catch(e) {
@@ -328,7 +344,7 @@ class LiuLian {
328
344
  this.readline();
329
345
  let html = '<pre>';
330
346
  while (! this.eod) {
331
- let line = this.readline();
347
+ let line = this.readline(1);
332
348
  if (line == '||<') break;
333
349
  html += this.inline(line) + '\n';
334
350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kobalab/liulian",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Node.jsで動作するWebサイト作成ツール",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,16 +31,16 @@
31
31
  "nyc": "^15.1.0"
32
32
  },
33
33
  "dependencies": {
34
- "express": "^4.17.1",
35
- "express-session": "^1.17.1",
36
- "highlight.js": "^10.4.1",
34
+ "express": "^4.18.2",
35
+ "express-session": "^1.17.3",
36
+ "highlight.js": "^10.7.3",
37
37
  "markdown-it": "^12.3.2",
38
38
  "markdown-it-footnote": "^3.0.3",
39
- "mime": "^2.4.6",
39
+ "mime": "^2.6.0",
40
40
  "multer": "^1.4.5-lts.1",
41
41
  "passport": "^0.6.0",
42
42
  "passport-local": "^1.0.0",
43
- "session-file-store": "^1.4.0",
44
- "yargs": "^15.4.1"
43
+ "session-file-store": "^1.5.0",
44
+ "yargs": "^17.6.2"
45
45
  }
46
46
  }