Code Block for Custom Language

Dear all,
I am in the middle of debugging a code block rendering issue which seems to be related to this commit: Add Goldmark as the new default markdown handler

For a code block starts with ```sequence , my theme( even ) will be able to treat it as a signal to invoke js lib to draw a sequence diagram.
The code stopped working because my sequence diagram code block is now treated as language-fallback vs before it was treated as language-sequence .

Do you know the correct part of code I should read in order to ask hugo to autogen the language-sequence vs automatically resolve to language-fallback ?
My goal is to make sure I can instruct the hugo engine to retain whatever I specified as the code language instead of changing it to fallback .

For example, instead of language-fallback, could it be possible for the code block to be rendered as language-sequence?

Can you run hugo again,
because when iā€™m trying to reproduce this, Yes i got language-fallback once (ONLY ONCE),
then i regenerate again, it fixed by showing language-sequence. Then the bug never happened again. Weird.

Thanks for looking into this.

I run hugo again with the following command:

hugo -t even

Here is my hugo version:

PS C:\Users\mkmojo\blog> hugo version
Hugo Static Site Generator v0.73.0-428907CC windows/amd64 BuildDate: 2020-06-23T16:32:10Z

I still got the same result with language-fallback.

Could it be related to my config.toml?
I had the following pygments related setting in the config file:

# Syntax highlighting by Chroma. NOTE: Don't enable `highlightInClient` and `chroma` at the same time!
pygmentsOptions = "linenos=table"
pygmentsCodefences = true
pygmentsUseClasses = true
pygmentsCodefencesGuessSyntax = true

ah you are right pygmentsCodefencesGuessSyntax = true caused the language-fallback.

if you are no longer using pygment then you can remove all the pygment related config.

1 Like

Thank a lot @pamubay!
My hugo now generates language-sequence as well.

Because of your help I am one step closer to finding all the fixes!


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.