Emdash source with visual editor image upload fix
Fixes: 1. media.ts: wrap placeholder generation in try-catch 2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
17
packages/marketplace/tests/fixtures/audit/benign-network-usage/backend.js
vendored
Normal file
17
packages/marketplace/tests/fixtures/audit/benign-network-usage/backend.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export default {
|
||||
hooks: {
|
||||
"content:beforeSave": async (event, ctx) => {
|
||||
const text = event.content.title + " " + (event.content.excerpt || "");
|
||||
const response = await ctx.http.fetch("https://api.spellcheck.example.com/check", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ text, lang: "en" }),
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.corrections?.length > 0) {
|
||||
ctx.log.info(
|
||||
`Found ${result.corrections.length} spelling issues in "${event.content.title}"`,
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
1
packages/marketplace/tests/fixtures/audit/benign-network-usage/expected.json
vendored
Normal file
1
packages/marketplace/tests/fixtures/audit/benign-network-usage/expected.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{ "verdict": "pass", "maxRiskScore": 10, "categories": [] }
|
||||
10
packages/marketplace/tests/fixtures/audit/benign-network-usage/manifest.json
vendored
Normal file
10
packages/marketplace/tests/fixtures/audit/benign-network-usage/manifest.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "spellcheck",
|
||||
"version": "1.0.0",
|
||||
"capabilities": ["read:content", "network:fetch"],
|
||||
"allowedHosts": ["api.spellcheck.example.com"],
|
||||
"storage": {},
|
||||
"hooks": ["content:beforeSave"],
|
||||
"routes": [],
|
||||
"admin": {}
|
||||
}
|
||||
Reference in New Issue
Block a user