brightspace-mcp-server 5.1.15 → 5.1.16
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,11 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2026 Rohan Muppa. All rights reserved.
|
|
4
4
|
* Licensed under MIT — see LICENSE file for details.
|
|
5
5
|
*/
|
|
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
|
+
}
|
|
6
10
|
/** Decode the character references Brightspace's HTML editor writes into attribute values. */
|
|
7
11
|
export function decodeEntities(value) {
|
|
8
12
|
return value
|
|
9
|
-
.replace(/&#x([0-9a-f]+);/gi, (
|
|
10
|
-
.replace(/&#(\d+);/g, (
|
|
13
|
+
.replace(/&#x([0-9a-f]+);/gi, (whole, hex) => codePoint(whole, parseInt(hex, 16)))
|
|
14
|
+
.replace(/&#(\d+);/g, (whole, dec) => codePoint(whole, parseInt(dec, 10)))
|
|
11
15
|
.replace(/"/g, '"')
|
|
12
16
|
.replace(/</g, "<")
|
|
13
17
|
.replace(/>/g, ">")
|
|
@@ -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.16",
|
|
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",
|