Skip to content

Commit 92715eb

Browse files
committed
fix list
1 parent eea3bc2 commit 92715eb

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

dist/nous-chat.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Chat.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,29 @@ renderer.heading = (text, level, raw) => {
8585
return `<h${level} class="ns-pt-2 ns-pb-2 ns-text-white">${text}</h${level}>\n`;
8686
};
8787
88+
renderer.list = (body, ordered, start) => {
89+
const type = ordered ? "ol" : "ul";
90+
const startatt = ordered && start !== 1 ? ' start="' + start + '"' : "";
91+
const listClass = ordered ? "ns-list-decimal" : "ns-list-disc";
92+
return (
93+
"<" +
94+
type +
95+
startatt +
96+
" class='ns-gap-2 ns-grid ns-pt-2 ns-pl-4 " +
97+
listClass +
98+
"'>\n" +
99+
body +
100+
"</" +
101+
type +
102+
">\n"
103+
);
104+
};
105+
106+
renderer.listitem = (text, task, checked) => {
107+
const s = `<li>${text.trim()}</li>\n`;
108+
return s;
109+
};
110+
88111
const options = ref({
89112
gfm: true,
90113
breaks: true,

src/components/NousChat.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,16 @@ const props = defineProps({
106106
default: "SpecialInitPayLoadDoNotTouch",
107107
},
108108
zIndex: {
109+
type: Number,
110+
default: 1000,
111+
},
112+
width: {
113+
type: String,
114+
default: "364px",
115+
},
116+
height: {
109117
type: String,
110-
default: "1000",
118+
default: "620px",
111119
},
112120
asrChunk: {
113121
type: Number,
@@ -143,8 +151,8 @@ onMounted(() => {
143151
const widgetStyle = computed(() => ({
144152
"--nous-chat-color": props.color,
145153
"--nous-chat-z-index": props.zIndex,
146-
"--nous-chat-width": "364px",
147-
"--nous-chat-height": "620px",
154+
"--nous-chat-width": props.width,
155+
"--nous-chat-height": props.height,
148156
}));
149157
150158
// Functions

0 commit comments

Comments
 (0)