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

markup/goldmark: Support extras extension #12459

Merged
merged 1 commit into from
May 10, 2024

Conversation

jmooring
Copy link
Member

@jmooring jmooring commented May 4, 2024

Enables inclusion of these HTML elements in Markdown:

  • Inserted Text (++inserted++)
  • Mark Text (==marked==)
  • Subscript (H~2~O)
  • Superscript (1^st^)

Default configuration:

markup:
  goldmark:
    extensions:
      extras:
        insert:
          enable: false
        mark:
          enable: false
        subscript:
          enable: false
        superscript:
          enable: false

@jmooring jmooring marked this pull request as draft May 4, 2024 01:10
@jmooring
Copy link
Member Author

jmooring commented May 4, 2024

@bowman2001 Building from this PR should just work. Note the configuration structure in the comment above; one extension with four options.

See documentation preview:
https://deploy-preview-2555--gohugoio.netlify.app/getting-started/configuration-markup/#extras-extension

Also see description in the Hugo Goldmark Extensions README:
https://github.com/gohugoio/hugo-goldmark-extensions?tab=readme-ov-file#extras-extension

And a one page test site with some simple tests:

git clone --single-branch -b hugo-github-issue-12459 https://github.com/jmooring/hugo-testing hugo-github-issue-12459
cd hugo-github-issue-12459
hugo server

Looks good to me. Next steps:

  • Review of extension code (bep)
  • Update extension test matrix (hugo-goldmark-extensions#19) (bep)
  • Tag an extension release (v0.1.0) (jmooring)
  • Update this PR to reflect the extension version (jmooring)

Portability with other apps/systems:

Inserted text Mark Subscript Superscript
GitHub no no no no
GitLab no no no no
Obsidian no yes no no
Typora no yes yes yes
VS Code no requires extension no requires extension

@jmooring jmooring force-pushed the goldmark-extras-extension branch 2 times, most recently from c0f746b to 380499b Compare May 4, 2024 11:46
@bowman2001
Copy link

Thanks a lot! Your integration test is way more concise than mine was.

@jmooring jmooring force-pushed the goldmark-extras-extension branch from 380499b to 97e6920 Compare May 5, 2024 14:39
@jmooring jmooring marked this pull request as ready for review May 5, 2024 14:40
@jmooring jmooring force-pushed the goldmark-extras-extension branch from 97e6920 to dace0d2 Compare May 5, 2024 14:42
markup/goldmark/convert.go Outdated Show resolved Hide resolved
@jmooring jmooring force-pushed the goldmark-extras-extension branch 2 times, most recently from 5b40662 to adbd7cb Compare May 8, 2024 16:13
Enables inclusion of these HTML elements in Markdown:

- Inserted Text (++inserted++)
- Mark Text (==marked==)
- Subscript (H~2~O)
- Superscript (1^st^)
@jmooring jmooring force-pushed the goldmark-extras-extension branch from adbd7cb to 5ecc8d8 Compare May 8, 2024 16:13
@bep
Copy link
Member

bep commented May 10, 2024

This looks good now, I will merge this early next week and get it into the same release as the "pages from data" feature. I'm just holding it just in case I need to do a patch release for some other reason.

@bep bep merged commit ca9a77e into gohugoio:master May 10, 2024
8 checks passed
@jmooring jmooring deleted the goldmark-extras-extension branch May 10, 2024 21:59
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

Successfully merging this pull request may close these issues.

None yet

3 participants