SimpleChatTCRV:Markdown:User configurable per session
User can enable or disable the simple minded bruteforce markdown parsing from the per session settings. Add grey shading and align text to left wrt table headings of markdown to html converted tables.
This commit is contained in:
parent
edf4c6588d
commit
654e234a4e
|
|
@ -299,6 +299,7 @@ Chat Session specific settings
|
|||
* More flexibility to user wrt ExternalAi tool call ie ai calling ai
|
||||
* the user can change the default behaviour of tools being disabled and sliding window of 1
|
||||
* program restart will reset these back to the default
|
||||
* Ui module cleanup to avoid duplicated/unneeded boiler plates, including using updated jsdoc annotations
|
||||
* A simple minded basic Markdown to Html logic
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,9 @@ A lightweight simple minded ai chat client with a web front-end that supports mu
|
|||
|
||||
- Client side Sliding window Context control, using `iRecentUserMsgCnt`, helps limit context sent to ai model
|
||||
|
||||
- Optional auto trimming of trailing garbage from model outputs
|
||||
- Optional
|
||||
- simple minded markdown parsing of chat message text contents (default)
|
||||
- auto trimming of trailing garbage from model outputs
|
||||
|
||||
- Follows responsive design to try adapt to any screen size
|
||||
|
||||
|
|
|
|||
|
|
@ -125,8 +125,11 @@ body {
|
|||
word-break: break-word;
|
||||
hyphens: auto;
|
||||
}
|
||||
.chat-message-content thead {
|
||||
.chat-message-content thead th {
|
||||
text-align: left;
|
||||
background-color: lightgray;
|
||||
/* padding-inline: 1vmin; */
|
||||
border-radius: 0.4vmin;
|
||||
}
|
||||
.chat-message-content-live {
|
||||
overflow-wrap: break-word;
|
||||
|
|
|
|||
|
|
@ -1497,7 +1497,7 @@ class MultiChatUI {
|
|||
}
|
||||
for (const [name, content] of showList) {
|
||||
if (content.length > 0) {
|
||||
if (name == "content") {
|
||||
if ((name == "content") && (this.simpleChats[chatId].cfg.chatProps.bMarkdown)) {
|
||||
entry = document.createElement('div')
|
||||
let md = new mMD.MarkDown()
|
||||
md.process(content)
|
||||
|
|
@ -2105,6 +2105,7 @@ export class Config {
|
|||
* * only user messages following the latest system prompt is considered.
|
||||
*/
|
||||
iRecentUserMsgCnt: 5,
|
||||
bMarkdown: true,
|
||||
bCompletionFreshChatAlways: true,
|
||||
bCompletionInsertStandardRolePrefix: false,
|
||||
bTrimGarbage: true,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,15 @@
|
|||
//
|
||||
|
||||
|
||||
/**
|
||||
* A simple minded Markdown to Html convertor, which tries to support
|
||||
* basic forms of the below in a simple, stupid and some cases in a semi rigid way.
|
||||
* * headings
|
||||
* * fenced code blocks / pres
|
||||
* * unordered list
|
||||
* * tables
|
||||
* * horizontal line
|
||||
*/
|
||||
export class MarkDown {
|
||||
|
||||
constructor() {
|
||||
|
|
@ -32,9 +41,9 @@ export class MarkDown {
|
|||
}
|
||||
|
||||
/**
|
||||
* Try extract a table from markdown content,
|
||||
* one line at a time.
|
||||
* Try extract a table from markdown content, one line at a time.
|
||||
* This is a imperfect logic, but should give a rough semblance of a table many a times.
|
||||
* Purposefully allows for any text beyond table row end | marker to be shown.
|
||||
* @param {string} line
|
||||
*/
|
||||
process_table_line(line) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue