@rooode/dsh-plugin-preview 0.1.19 → 0.1.20
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 +13 -11
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
return t.split('|').map(c => c.trim());
|
|
959
959
|
};
|
|
960
960
|
|
|
961
|
-
const tableRegex = /^(
|
|
961
|
+
const tableRegex = /^([ \t]*\|?.+\|.*)\n([ \t]*\|?[ \t]*:?-+:?[ \t]*(?:\|[ \t]*:?-+:?[ \t]*)+\|?[ \t]*)(?:\n((?:[ \t]*\|.*\|.*(?:\n|$))*))?/gm;
|
|
962
962
|
text = text.replace(tableRegex, (match, headerLine, alignLine, bodyLines) => {
|
|
963
963
|
const headerCells = parseTableRow(headerLine);
|
|
964
964
|
const alignCells = parseTableRow(alignLine);
|
|
@@ -975,16 +975,18 @@
|
|
|
975
975
|
});
|
|
976
976
|
tableHtml += '</tr></thead><tbody>';
|
|
977
977
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
978
|
+
if (bodyLines) {
|
|
979
|
+
const rows = bodyLines.trim().split('\n');
|
|
980
|
+
for (const row of rows) {
|
|
981
|
+
if (!row.trim()) continue;
|
|
982
|
+
const cells = parseTableRow(row);
|
|
983
|
+
tableHtml += '<tr>';
|
|
984
|
+
cells.forEach((cell, i) => {
|
|
985
|
+
const align = aligns[i] || 'left';
|
|
986
|
+
tableHtml += `<td style="text-align:${align}">${formatInlineStyles(cell)}</td>`;
|
|
987
|
+
});
|
|
988
|
+
tableHtml += '</tr>';
|
|
989
|
+
}
|
|
988
990
|
}
|
|
989
991
|
tableHtml += '</tbody></table></div>\n\n';
|
|
990
992
|
return tableHtml;
|
package/lib/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export class PreviewService extends Service {
|
|
|
29
29
|
handler: this.handleHttpRequest.bind(this),
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
console.log('[PreviewService] Registered /api/preview route on webServer (v0.1.
|
|
32
|
+
console.log('[PreviewService] Registered /api/preview route on webServer (v0.1.20)');
|
|
33
33
|
} else {
|
|
34
34
|
console.warn('[PreviewService] webServer not available yet in ctx');
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rooode/dsh-plugin-preview",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "DeepSeek Harness Markdown 文档与工作空间文件浏览器右侧预览插件 (支持工作区文件树、文件夹创建与文件移动、JSON 交互结构树/格式化、Java/C++/Python/JS/TS/YAML/Go/Rust 多语言语法高亮与符号大纲、自动换行与多标签 FileTabs)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|