Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior when including code snippets in an alert #183

Closed
sharifsalah opened this issue Jan 29, 2020 · 7 comments
Closed

Inconsistent behavior when including code snippets in an alert #183

sharifsalah opened this issue Jan 29, 2020 · 7 comments

Comments

@sharifsalah
Copy link
Contributor

Currently, when we include a code snippet in an alert we see inconsistent behavior:

  1. Using back ticks:
{{% alert %}} Here's an example command:

    ```shell
    my example command
    ```

    {{% /alert %}}

Results in the back ticks displaying in the rendered HTML.

  1. Using indentation alone:
{{% alert %}} Here's an example command:

    my example command

    {{% /alert %}}

Results in the code snippet rendering correctly (even though the command isn't really indented).

For screenshots, see AcademySoftwareFoundation/opencue.io#147

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 29, 2020

I'll have a look! Which version of Hugo are you using? The 0.60 versions and up use a different Markdown processor (Goldmark) which is mildly less weird than Blackfriday.

@sharifsalah
Copy link
Contributor Author

Thanks @LisaFC! We're running a version of Hugo prior to 0.6.0, so I'll experiment with updating and report back if that fixes the behavior.

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 29, 2020

Be aware that it may break other things! :)

https://www.docsy.dev/docs/adding-content/content/#page-contents-and-markup

There's also a rogue div that may appear on your landing page depending on how much customization you did, which you can just delete: #174

@sharifsalah
Copy link
Contributor Author

sharifsalah commented Jan 29, 2020

Thanks again, that all helped!

To update you on the original issue, I've tried updating Hugo, Docsy, and enabling HTML in Markdown. The site is generally looking as expected. I can still see the strange behavior in the description for this issue:

https://deploy-preview-150--elated-haibt-1b47ff.netlify.com/docs/getting-started/setting-up-the-database/

If you want to see it, you can search for the following string on that page:

```shell

Not a big issue but worth reporting :)

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 29, 2020

Ok! Let's see if I can figure it out....

@RichieEscarez
Copy link
Contributor

This sounds like it might be the cause: gohugoio/hugo#5831 (comment)

@LisaFC
Copy link
Collaborator

LisaFC commented May 26, 2023

Closing as looks like this was fixed in Hugo.

@LisaFC LisaFC closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants