Skip to content

Commit

Permalink
fix list
Browse files Browse the repository at this point in the history
  • Loading branch information
huseinzol05 committed Sep 19, 2024
1 parent eea3bc2 commit 92715eb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
5 changes: 4 additions & 1 deletion dist/nous-chat.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/components/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@ renderer.heading = (text, level, raw) => {
return `<h${level} class="ns-pt-2 ns-pb-2 ns-text-white">${text}</h${level}>\n`;
};
renderer.list = (body, ordered, start) => {
const type = ordered ? "ol" : "ul";
const startatt = ordered && start !== 1 ? ' start="' + start + '"' : "";
const listClass = ordered ? "ns-list-decimal" : "ns-list-disc";
return (
"<" +
type +
startatt +
" class='ns-gap-2 ns-grid ns-pt-2 ns-pl-4 " +
listClass +
"'>\n" +
body +
"</" +
type +
">\n"
);
};
renderer.listitem = (text, task, checked) => {
const s = `<li>${text.trim()}</li>\n`;
return s;
};
const options = ref({
gfm: true,
breaks: true,
Expand Down
14 changes: 11 additions & 3 deletions src/components/NousChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,16 @@ const props = defineProps({
default: "SpecialInitPayLoadDoNotTouch",
},
zIndex: {
type: Number,
default: 1000,
},
width: {
type: String,
default: "364px",
},
height: {
type: String,
default: "1000",
default: "620px",
},
asrChunk: {
type: Number,
Expand Down Expand Up @@ -143,8 +151,8 @@ onMounted(() => {
const widgetStyle = computed(() => ({
"--nous-chat-color": props.color,
"--nous-chat-z-index": props.zIndex,
"--nous-chat-width": "364px",
"--nous-chat-height": "620px",
"--nous-chat-width": props.width,
"--nous-chat-height": props.height,
}));
// Functions
Expand Down

0 comments on commit 92715eb

Please sign in to comment.