@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 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
- const text = html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n").replace(/<[^>]+>/g, "").replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").trim();
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(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/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
- const text = html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n").replace(/<[^>]+>/g, "").replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").trim();
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(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/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",
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.12",
36
- "@ever-works/plugin": "^1.2.9",
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:38f36017a0e1712bdc4becbc5d1865483b0275662a827603ac66ab5e238eaa7d",
111
- "commit": "5b5a17e1cdc02e06383d508a6424a863521fc3e0",
112
- "source": "https://github.com/ever-works/ever-works/tree/5b5a17e1cdc02e06383d508a6424a863521fc3e0/packages/plugins/mastodon-connector"
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
  }