brightspace-mcp-server 5.1.15 → 5.1.17
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.
|
@@ -3,15 +3,24 @@
|
|
|
3
3
|
* Copyright (c) 2026 Rohan Muppa. All rights reserved.
|
|
4
4
|
* Licensed under MIT — see LICENSE file for details.
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/** A numeric reference as its character, or left as written when it names no code point (issue #352). */
|
|
7
|
+
function codePoint(whole, code) {
|
|
8
|
+
return code <= 0x10ffff ? String.fromCodePoint(code) : whole;
|
|
9
|
+
}
|
|
10
|
+
const NAMED = { quot: '"', lt: "<", gt: ">", amp: "&" };
|
|
11
|
+
/**
|
|
12
|
+
* Decode the character references Brightspace's HTML editor writes into
|
|
13
|
+
* attribute values, in one pass so a decoded `&` never starts another
|
|
14
|
+
* reference: `&lt;` is the text `<`, not `<` (issue #360).
|
|
15
|
+
*/
|
|
7
16
|
export function decodeEntities(value) {
|
|
8
|
-
return value
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
return value.replace(/&(?:#[xX]([0-9a-fA-F]+)|#(\d+)|(quot|lt|gt|amp));/g, (whole, hex, dec, name) => {
|
|
18
|
+
if (hex !== undefined)
|
|
19
|
+
return codePoint(whole, parseInt(hex, 16));
|
|
20
|
+
if (dec !== undefined)
|
|
21
|
+
return codePoint(whole, parseInt(dec, 10));
|
|
22
|
+
return NAMED[name];
|
|
23
|
+
});
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
26
|
* The attributes of every `<tag>` element in `html`, names lowercased and
|
|
@@ -26,11 +26,11 @@ function decodeEntities(text) {
|
|
|
26
26
|
return ENTITIES[key];
|
|
27
27
|
if (key.startsWith("#x")) {
|
|
28
28
|
const code = Number.parseInt(key.slice(2), 16);
|
|
29
|
-
return Number.isFinite(code) && code > 0 ? String.fromCodePoint(code) : whole;
|
|
29
|
+
return Number.isFinite(code) && code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : whole;
|
|
30
30
|
}
|
|
31
31
|
if (key.startsWith("#")) {
|
|
32
32
|
const code = Number.parseInt(key.slice(1), 10);
|
|
33
|
-
return Number.isFinite(code) && code > 0 ? String.fromCodePoint(code) : whole;
|
|
33
|
+
return Number.isFinite(code) && code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : whole;
|
|
34
34
|
}
|
|
35
35
|
return whole;
|
|
36
36
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brightspace-mcp-server",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.17",
|
|
4
4
|
"mcpName": "io.github.RohanMuppa/brightspace",
|
|
5
5
|
"description": "MCP server for Brightspace (D2L). Check grades, due dates, assignments, announcements, syllabus, rosters and more via Claude, ChatGPT, Cursor, Windsurf, or any MCP client.",
|
|
6
6
|
"type": "module",
|