@ever-works/mastodon-connector-plugin 1.0.3 → 1.0.4
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/dist/index.cjs +8 -1
- package/dist/index.js +8 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -151,7 +151,14 @@ function truncateText(text) {
|
|
|
151
151
|
}
|
|
152
152
|
function stripStatusHtml(html) {
|
|
153
153
|
if (typeof html !== "string" || html.length === 0) return void 0;
|
|
154
|
-
|
|
154
|
+
let stripped = html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n");
|
|
155
|
+
let previous;
|
|
156
|
+
let passes = 0;
|
|
157
|
+
do {
|
|
158
|
+
previous = stripped;
|
|
159
|
+
stripped = stripped.replace(/<[^<>]+>/g, "");
|
|
160
|
+
} while (stripped !== previous && ++passes < 32);
|
|
161
|
+
const text = stripped.replace(/(?<!<)<+(?=[a-z/!?])/gi, "").replace(/ /g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").trim();
|
|
155
162
|
return text.length > 0 ? text : void 0;
|
|
156
163
|
}
|
|
157
164
|
function resolveVisibility(value) {
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,14 @@ function truncateText(text) {
|
|
|
147
147
|
}
|
|
148
148
|
function stripStatusHtml(html) {
|
|
149
149
|
if (typeof html !== "string" || html.length === 0) return void 0;
|
|
150
|
-
|
|
150
|
+
let stripped = html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n");
|
|
151
|
+
let previous;
|
|
152
|
+
let passes = 0;
|
|
153
|
+
do {
|
|
154
|
+
previous = stripped;
|
|
155
|
+
stripped = stripped.replace(/<[^<>]+>/g, "");
|
|
156
|
+
} while (stripped !== previous && ++passes < 32);
|
|
157
|
+
const text = stripped.replace(/(?<!<)<+(?=[a-z/!?])/gi, "").replace(/ /g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").trim();
|
|
151
158
|
return text.length > 0 ? text : void 0;
|
|
152
159
|
}
|
|
153
160
|
function resolveVisibility(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ever-works/mastodon-connector-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Mastodon social connector plugin for Ever Works platform (outbound statuses via the masto SDK, and event-source pull of mentions/notifications plus the account's own statuses into the event-ingest pipeline, with opt-in historical backfill)",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ever Co. LTD",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test:watch": "vitest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ever-works/contracts": "^1.0.
|
|
36
|
-
"@ever-works/plugin": "^1.2.
|
|
35
|
+
"@ever-works/contracts": "^1.0.19",
|
|
36
|
+
"@ever-works/plugin": "^1.2.16",
|
|
37
37
|
"masto": "^7.12.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"url": "https://github.com/ever-works/ever-works/issues"
|
|
108
108
|
},
|
|
109
109
|
"everworksRelease": {
|
|
110
|
-
"contentHash": "sha256:
|
|
111
|
-
"commit": "
|
|
112
|
-
"source": "https://github.com/ever-works/ever-works/tree/
|
|
110
|
+
"contentHash": "sha256:33c7d4e01e69084d7f8356af1ac651aeadb3717cb5920efd8c1de43435fbc401",
|
|
111
|
+
"commit": "89cee44a662034ea957b07ec5e1230ecf340b107",
|
|
112
|
+
"source": "https://github.com/ever-works/ever-works/tree/89cee44a662034ea957b07ec5e1230ecf340b107/packages/plugins/mastodon-connector"
|
|
113
113
|
}
|
|
114
114
|
}
|