Anyone maybe knows a working example
Chat Stream alternating code /code fields from 3 backticks
struggling with innerText and innerHTML
i can replace tripple backticks alternating
but have problems with linebreaks and br
for example if i
the response is text and code between 3 backticks
i would like them to be in a code field
so that it can be pasted at cursor position in ace editor / html previewer
if any one maybe knows an example in python
ChatGPT uses a standard markdown to HTML library.
Why do I need to know the word markdown?
It is a standard text formatting that allows one to type an entire post into a forum with a keyboard, and have it displayed in the manner desired.
- This Discourse-based forum uses a markdown renderer;
- ChatGPT uses a markdown renderer
Code blocks in markdown
Single and triple backticks are markdown to represent preformatted text and a code block, and text within such a container format is rendered as monospace text.
Like the forum, you will need to use a library that understands the rules of markdown, and what sequences will break out of the containers.
this for example is a code block.
Using a code block, I can
display `backticks` without
breaking the container.
Triple-backticks (```) only represent
a code block on their own line.
If you don't like the code block being interpreted
and rendered incorrectly, you can specify the
programming language by starting the code block as:
then you get un-colored text. Also that ``` didn't break
out of the code block, you notice.
Because of the strict standardized rules, a library rather than your intuition is required. This will help you render the text produced by the AI that has similar understanding.
Big text comes from # and a space on a new line, rendered as an HTML <H1>Conclusion</H1>. It does not need to be closed. Typing <h1> however needs to be escaped as \<h1>, and showing someone that requires \\\<h1> be typed out, and so on.
Understand what ChatGPT is doing, and you’ll have success.
Ok thank you for your explanation
github uses readme.md
now i understand the idea a bit better
trying to figure out how the response json works
by printing things to the console
i will search
for a small
a mechanic that screw things, proud to say ( with your help eye )
ok md to html
after chat stream is recieved