dsh-plugin-lookatstudy 0.25.2 → 0.25.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/lib/client.js +292 -6
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +16 -0
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1130,6 +1130,21 @@ function normalizeSpeechText(md) {
|
|
|
1130
1130
|
s = s.replace(/`[^`\n]*`/g, "");
|
|
1131
1131
|
s = s.replace(/!\[[^\]]*\]\([^)\n]*\)/g, "");
|
|
1132
1132
|
s = s.replace(/\[([^\]]+)\]\([^)\n]*\)/g, "$1");
|
|
1133
|
+
s = s.replace(/\[\]\([^)\n]*\)/g, "");
|
|
1134
|
+
s = s.replace(/<br\s*\/?>/gi, "\n");
|
|
1135
|
+
s = s.replace(/<https?:\/\/[^>\s]+>/g, "");
|
|
1136
|
+
s = s.replace(/https?:\/\/[^\s)\]]+/g, "");
|
|
1137
|
+
s = s.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, "\n");
|
|
1138
|
+
s = s.replace(/<[^>\n]+>/g, "");
|
|
1139
|
+
s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/�?39;/g, "'").replace(/ /g, " ").replace(/&#(\d+);/g, (_m, d) => {
|
|
1140
|
+
try {
|
|
1141
|
+
return String.fromCodePoint(Number(d));
|
|
1142
|
+
} catch {
|
|
1143
|
+
return "";
|
|
1144
|
+
}
|
|
1145
|
+
}).replace(/&[a-z]+;/gi, "");
|
|
1146
|
+
s = s.replace(/\[([^\]]+)\]\[[^\]]*\]/g, "$1");
|
|
1147
|
+
s = s.replace(/\[\^[^\]]*\]/g, "");
|
|
1133
1148
|
s = s.replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm, "");
|
|
1134
1149
|
s = s.replace(/^[ \t]*(?:[-*+]|\d+\.)[ \t]+/gm, "");
|
|
1135
1150
|
s = s.replace(/^[ \t]*>[ \t]?/gm, "");
|
|
@@ -3122,6 +3137,7 @@ function workbenchState(state, now) {
|
|
|
3122
3137
|
speechText: normalizeSpeechText(normalizeMathNotation(ref.lesson.body)),
|
|
3123
3138
|
...ref.lesson.translation !== void 0 ? {
|
|
3124
3139
|
translationHtml: renderMarkdown(normalizeMathNotation(ref.lesson.translation)),
|
|
3140
|
+
translationSpeechText: normalizeSpeechText(normalizeMathNotation(ref.lesson.translation)),
|
|
3125
3141
|
translationLang: ref.lesson.translationLang ?? ""
|
|
3126
3142
|
} : {}
|
|
3127
3143
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-lookatstudy",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.4",
|
|
4
4
|
"packageManager": "pnpm@11.7.0",
|
|
5
5
|
"description": "Turn any markdown, local folder, or GitHub learning repo into a guided course inside DeepSeek Harness: gated skill-tree progression, BKT mastery tracking, SM-2 spaced repetition.",
|
|
6
6
|
"type": "module",
|