@kobalab/liulian 1.1.5 → 1.1.7
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 +18 -0
- package/lib/html/index.js +14 -2
- package/lib/text/inline.js +11 -4
- package/lib/text/liulian.js +1 -1
- package/package.json +7 -7
package/ChangeLog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
### v1.1.7 / 2023-03-17
|
|
2
|
+
|
|
3
|
+
- [Twitterカード](https://developer.twitter.com/ja/docs/tweets/optimize-with-cards/guides/getting-started) に対応
|
|
4
|
+
- 外部リンクを別タブで開くよう修正
|
|
5
|
+
- 脆弱性警告に対処(json5 2.1.3 → 2.2.3)
|
|
6
|
+
|
|
7
|
+
### v1.1.6 / 2022-12-08
|
|
8
|
+
|
|
9
|
+
- highlight() の deprecated な呼び出し方法を修正
|
|
10
|
+
- 脆弱性警告に対処(qs 6.7.0 → 6.11.0)
|
|
11
|
+
- パッケージを最新化
|
|
12
|
+
- express 4.17.1 → 4.18.2
|
|
13
|
+
- express-session 1.17.1 → 1.17.3
|
|
14
|
+
- highlight.js 10.4.1 → 10.7.3
|
|
15
|
+
- mime 2.4.6 → 2.6.0
|
|
16
|
+
- session-file-store 1.4.0 → 1.5.0
|
|
17
|
+
- yargs 15.4.1 → 17.6.2
|
|
18
|
+
|
|
1
19
|
### v1.1.5 / 2022-10-25
|
|
2
20
|
|
|
3
21
|
- #8 整形済みテキスト内などで不必要な行連結を行なっているバグを修正
|
package/lib/html/index.js
CHANGED
|
@@ -88,6 +88,13 @@ module.exports = class HTML {
|
|
|
88
88
|
`<script>\n${opt.code}</script>\n`
|
|
89
89
|
).join('');
|
|
90
90
|
|
|
91
|
+
const ogp = '<meta name="twitter:card" content="summary">\n'
|
|
92
|
+
+ '<meta property="og:title" '
|
|
93
|
+
+ `content="${cref(this.title())}">\n`
|
|
94
|
+
+ '<meta property="og:image" content="'
|
|
95
|
+
+ this._req.fullUrl(fixpath(this._.icon, req.baseUrl))
|
|
96
|
+
+ '>\n';
|
|
97
|
+
|
|
91
98
|
const meta = this._.meta.map(attr=>{
|
|
92
99
|
let attrs = Object.keys(attr).map(key=>
|
|
93
100
|
`${cdata(key)}="${cdata(attr[key])}"`).join(' ');
|
|
@@ -100,6 +107,7 @@ module.exports = class HTML {
|
|
|
100
107
|
+ 'content="width=device-width, initial-scale=1">\n'
|
|
101
108
|
+ meta
|
|
102
109
|
+ `<title>${cref(this.title())}</title>\n`
|
|
110
|
+
+ ogp
|
|
103
111
|
+ scriptRef
|
|
104
112
|
+ icon
|
|
105
113
|
+ stylesheet
|
|
@@ -142,10 +150,14 @@ module.exports = class HTML {
|
|
|
142
150
|
}
|
|
143
151
|
|
|
144
152
|
_footer() {
|
|
153
|
+
let original = this._req.scheme + '://' + this._req.host
|
|
154
|
+
+ this._req.baseUrl
|
|
155
|
+
== this._req.productUrl.replace(/\/$/,'');
|
|
145
156
|
return `<div id="l-footer">\n`
|
|
146
157
|
+ `<hr>\n`
|
|
147
|
-
+ `<address><a href="${cdata(this._req.productUrl)}"
|
|
148
|
-
+
|
|
158
|
+
+ `<address><a href="${cdata(this._req.productUrl)}"`
|
|
159
|
+
+ (original ? '' : ' target="_blank"')
|
|
160
|
+
+ `>LiuLian/${cdata(this._req.version)}</a></address>\n`
|
|
149
161
|
+ `</div>\n`;
|
|
150
162
|
}
|
|
151
163
|
|
package/lib/text/inline.js
CHANGED
|
@@ -43,7 +43,9 @@ const mark_pt = m3.replace(/\s+/g,'');
|
|
|
43
43
|
|
|
44
44
|
function link(str) {
|
|
45
45
|
let href = str.match(/:/) ? str : 'mailto:' + str;
|
|
46
|
-
return
|
|
46
|
+
return href.match(/^mailto:/)
|
|
47
|
+
? `<a href="${cdata(href)}">${cdata(str)}</a>`
|
|
48
|
+
: `<a href="${cdata(href)}" target="_blank">${cdata(str)}</a>`;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
const text = replacer(link_pt, link, cref);
|
|
@@ -88,12 +90,17 @@ module.exports = function(parser) {
|
|
|
88
90
|
|
|
89
91
|
function bracket(str) {
|
|
90
92
|
if (str.match(/^[^|]*$/)) {
|
|
91
|
-
return `<a href="${cdata(fixlink(str))}"
|
|
92
|
-
+
|
|
93
|
+
return `<a href="${cdata(fixlink(str))}"`
|
|
94
|
+
+ (str.match(/^(?:https?:|ftp:|\/\/)/)
|
|
95
|
+
? ' target="_blank"' : '')
|
|
96
|
+
+ `>${cdata(str)}</a>`;
|
|
93
97
|
}
|
|
94
98
|
else {
|
|
95
99
|
let [ , title, href ] = str.match(/^(.*)\|(.*)$/);
|
|
96
|
-
return `<a href="${cdata(fixlink(href))}"
|
|
100
|
+
return `<a href="${cdata(fixlink(href))}"`
|
|
101
|
+
+ (href.match(/^(?:https?:|ftp:|\/\/)/)
|
|
102
|
+
? ' target="_blank"' : '')
|
|
103
|
+
+ `>${inline(title)}</a>`;
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
|
package/lib/text/liulian.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kobalab/liulian",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
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.
|
|
35
|
-
"express-session": "^1.17.
|
|
36
|
-
"highlight.js": "^10.
|
|
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.
|
|
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.
|
|
44
|
-
"yargs": "^
|
|
43
|
+
"session-file-store": "^1.5.0",
|
|
44
|
+
"yargs": "^17.6.2"
|
|
45
45
|
}
|
|
46
46
|
}
|