Shortcode for highlight http generates "false positives"

I’m using this shortcode to render a block of http output:
{{< highlight http >}}

I believe the http is valid syntactically (and ChatGPT agrees) but every line of the output is getting “flagged” for invalid syntax – see the screenshot below. Can anyone tell me either what’s wrong with the input or how to override syntax checking in this shortcode?

The first part of the .md –

{{< highlight http >}}
HTTP/2 200
cache-control: no-cache, no-store, must-revalidate, max-age=0
content-type: application/json; charset=UTF-8
pragma: no-cache
strict-transport-security: max-age=31536000; includeSubdomains
vary: Origin, Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
date: Sun, 09 Jul 2023 13:20:51 GMT
x-envoy-upstream-service-time: 3
server: envoy

{
“count”: 1,
“page”: 1,
“pagesize”: 100,

The first part of the rendering

hugo-temp

Which highlighting style are you using?

And which version of Hugo?

Thanks for responding. Please tell me where to find both pieces of information. I’m responsible for writing the content, and do not have very much knowledge of the internals. Thanks!

Then we need to look at few things.

First, type hugo version and paste the results here.

Second, copy and paste the [markup.highlight] portion of your site configuration.

Third, does this file exist in either location?

  • layouts/shortcodes/highlight.html
  • themes/xxx/layouts/shortcodes/highlight.html

If yes, please paste here.


And I am not able to reproduce the behavior with any of the highlighting styles using v0.115.2. For example, with the “manni” style:

image

One more test. Paste this markdown into one of your markdown files:

this is `inline` code

Then build the site, grab a screen capture of the rendered line, and paste it here.

First, type hugo version and paste the results here.

Sorry… I don’t know where to type this :confused:

Second, copy and paste the [markup.highlight] portion of your site configuration.

I found this in the file \themes\zdoc\config_default\config.toml –

[markup.highlight]
codeFences = true
lineNos = true
lineNumbersInTable = true
noClasses = false

Third, does this file exist in either location?

layouts/shortcodes/highlight.html – NO

themes/xxx/layouts/shortcodes/highlight.html – NO

Paste this markdown into one of your markdown files: this is inline code

Here’s the screen capture:

this-is-inline-code

Is there someone in your organization who has technical responsibility for your project? Or perhaps a vendor/agency who built this for you?

Without access to your project repository I am unable to help.

1 Like

The site was built by an outside company; we no longer have a business relationship with them. However, I answered all of your questions except for “hugo version”. I would think that information would be relatively easy to dig out of a config file. But if you need to access the project repo, that’s a whole other thing.

It’s not in a config file. You get the information by typing the command on the command line.

Feel free to share the repository privately.

Understood. Perhaps I don’t know which command line you mean.

I use a laptop with Windows to edit my portal. So I tried typing “hugo version” on the Windows command line… " ‘hugo’ is not recognized as an internal or external command, operable program or batch file."

So I’m stuck… and why I suggested that the Hugo version might be readable from one of the config files.

@jmooring Update with good news: Our system guru updated our Hugo from 0.101.0 to 0.115.2, and the code blocks with “HTTP/2 200 OK” render fine now. Thanks for your assistance!

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