mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Provide in-line rendering when output matches certain views
This commit is contained in:
parent
ec06d2c446
commit
a0b12b001a
2 changed files with 24 additions and 0 deletions
|
@ -139,6 +139,8 @@
|
||||||
newHTML = newHTML.replace(/__([\s\S]*?)__/g, '<u>$1</u>');
|
newHTML = newHTML.replace(/__([\s\S]*?)__/g, '<u>$1</u>');
|
||||||
// Remove any text between <s>[INST] and </s> tags. These are spurious instructions for the AI chat model.
|
// Remove any text between <s>[INST] and </s> tags. These are spurious instructions for the AI chat model.
|
||||||
newHTML = newHTML.replace(/<s>\[INST\].+(<\/s>)?/g, '');
|
newHTML = newHTML.replace(/<s>\[INST\].+(<\/s>)?/g, '');
|
||||||
|
// For any text that has single backticks, replace them with <code> tags
|
||||||
|
newHTML = newHTML.replace(/`([^`]+)`/g, '<code class="chat-response">$1</code>');
|
||||||
return newHTML;
|
return newHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,6 +575,16 @@
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code.chat-response {
|
||||||
|
background: var(--primary-hover);
|
||||||
|
color: var(--primary-inverse);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
button.reference-button {
|
button.reference-button {
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
color: var(--main-text-color);
|
color: var(--main-text-color);
|
||||||
|
|
|
@ -148,6 +148,8 @@ To get started, just start typing below. You can also type / to see a list of co
|
||||||
newHTML = newHTML.replace(/__([\s\S]*?)__/g, '<u>$1</u>');
|
newHTML = newHTML.replace(/__([\s\S]*?)__/g, '<u>$1</u>');
|
||||||
// Remove any text between <s>[INST] and </s> tags. These are spurious instructions for the AI chat model.
|
// Remove any text between <s>[INST] and </s> tags. These are spurious instructions for the AI chat model.
|
||||||
newHTML = newHTML.replace(/<s>\[INST\].+(<\/s>)?/g, '');
|
newHTML = newHTML.replace(/<s>\[INST\].+(<\/s>)?/g, '');
|
||||||
|
// For any text that has single backticks, replace them with <code> tags
|
||||||
|
newHTML = newHTML.replace(/`([^`]+)`/g, '<code class="chat-response">$1</code>');
|
||||||
return newHTML;
|
return newHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,6 +492,16 @@ To get started, just start typing below. You can also type / to see a list of co
|
||||||
background: var(--primary-hover);
|
background: var(--primary-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code.chat-response {
|
||||||
|
background: var(--primary-hover);
|
||||||
|
color: var(--primary-inverse);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
#chat-body {
|
#chat-body {
|
||||||
font-size: medium;
|
font-size: medium;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|
Loading…
Add table
Reference in a new issue