Quantcast
Viewing latest article 19
Browse Latest Browse All 180

What causes single backticks on every line of code?

There is an issue where code blocks contain single backticks around every single line, rather than triple fences around the entire code block. This destroys the formatting. An example can be seen in this post. I believe this to be a bug in or misguided use of the Ask-Question wizard, since adding single backticks manually to a hundred lines of code isn't something one would normally do.

From the example:

`from modules.prompt import create_conversation_prompt``from langchain.chains import ConversationChain``from langchain_core.output_parsers import StrOutputParser``from langchain_core.runnables import RunnablePassthrough`

renders as:

from modules.prompt import create_conversation_promptfrom langchain.chains import ConversationChainfrom langchain_core.output_parsers import StrOutputParserfrom langchain_core.runnables import RunnablePassthrough

Whereas

```lang-pythonfrom modules.prompt import create_conversation_promptfrom langchain.chains import ConversationChainfrom langchain_core.output_parsers import StrOutputParserfrom langchain_core.runnables import RunnablePassthrough```

renders correctly:

from modules.prompt import create_conversation_promptfrom langchain.chains import ConversationChainfrom langchain_core.output_parsers import StrOutputParserfrom langchain_core.runnables import RunnablePassthrough

How does this phenomenon arise and can it be prevented, e.g. by changing the question wizard?

Two semi-related posts:


Viewing latest article 19
Browse Latest Browse All 180

Trending Articles