nlkitai / nlux

The π—£π—Όπ˜„π—²π—Ώπ—³π˜‚π—Ή Conversational AI JavaScript Library πŸ’¬ β€”Β UI for any LLM, supporting LangChain / HuggingFace / Vercel AI, and more 🧑 React, Next.js, and plain JavaScript ⭐️
https://docs.nlkit.com/nlux
Other
943 stars 48 forks source link

Is it possible to support more markdown features, especially links? #10

Closed jungleau closed 2 weeks ago

jungleau commented 5 months ago

Thanks for creating this cool chatbot UI.

However, I found it only supports very limited Markdown features, such as bold and italic fonts. For example, I created below test adapter:

export const myTestAdapter: Adapter = {
    fetchText(message: string): Promise<string> {
        return new Promise((resolve) => {
            setTimeout(() => {
                const messageToStream = 'For more **detailed instructions**, you can refer to [more details](https://example.com)';
                resolve(messageToStream);
            }, 100);
        });
    },
};

The link was not rendered as I expected. Is it possible to support more markdown features, especially links? If you can support Tables, that would be even better :)

salmenus commented 5 months ago

@jungleau Glad that you find the library useful. Thanks for providing a reproducible example to illustrate the issue raised πŸ‘

We currently support the following markdown tags: Bold / Italic / Line break / Code blocks / Inline code / Headings.

As per your request, I added this task to the project roadmap
I'm aiming to deliver that next week ( before ~ 2nd Feb 24 ), as part of other markdown changes.

At first, I'll add markdown tags to comply with the basic markdown spec, which includes images, links, lists, and horizontal rules ..
Tables will come later though .. as they are part of the extended syntax. I added a feature request to track that.

jungleau commented 5 months ago

Thanks @salmenus Really appreciate that. Look forward to the new release in Feb.

salmenus commented 4 months ago

@jungleau Markdown parser for links added in v0.10.11 just published to NPM.

Screenshot 2024-02-09 at 14 50 14

Still working on adding images, lists, and horizontal rules. Give it a try let me know

jlev commented 4 months ago

lists would be super helpful for me, I have a langserve agent returning markdown from a RAG

thanks for the great library!

jlev commented 3 months ago

Also, is it possible to render images inline? That would be amazing.

salmenus commented 3 months ago

Alright. Adding lists and inline images @jlev atm

salmenus commented 3 weeks ago

Hi everyone β€”Β The latest markdown parser in NLUX is based on Marked and has full support for markdown features, including lists, links, and images βœ…

Please update to latest v2 to use it.

We will be adding more examples to documentation with more markdown features.

I'll be closing this issue in a few days