Skip to content

Commit

Permalink
Update Goldmark configuration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored and bep committed Jun 25, 2024
1 parent 4449d53 commit 6677a30
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
32 changes: 26 additions & 6 deletions content/en/getting-started/configuration-markup.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,33 +84,53 @@ typographer|[Goldmark Extensions: Typographer]|:heavy_check_mark:
[PHP Markdown Extra: Definition lists]: https://michelf.ca/projects/php-markdown/extra/#def-list
[PHP Markdown Extra: Footnotes]: https://michelf.ca/projects/php-markdown/extra/#footnotes

#### Extras extension
#### Extras

{{< new-in 0.126.0 >}}

Configure the extras extension to enable [inserted text], [mark text], [subscript], and [superscript] elements in Markdown.
Enable [deleted text], [inserted text], [mark text], [subscript], and [superscript] elements in Markdown.

Element|Markdown|Rendered
:--|:--|:--
Inserted text|`++foo++`|`<ins>foo</ins>`
Mark text|`==bar==`|`<mark>bar</mark>`
Deleted text|`~~foo~~`|`<del>foo</del>`
Inserted text|`++bar++`|`<ins>bar</ins>`
Mark text|`==baz==`|`<mark>baz</mark>`
Subscript|`H~2~O`|`H<sub>2</sub>O`
Superscript|`1^st^`|`1<sup>st</sup>`

[deleted text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
[inserted text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins
[mark text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
[subscript]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
[superscript]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup

#### Passthrough extension
To avoid a conflict when enabling the Hugo Goldmark Extras subscript extension, if you want to render subscript and strikethrough text concurrently you must:

1. Disable the Goldmark strikethrough extension
2. Enable the Hugo Goldmark Extras delete extension

For example:

{{< code-toggle file=hugo >}}
[markup.goldmark.extensions]
strikethrough = false

[markup.goldmark.extensions.extras.delete]
enable = true

[markup.goldmark.extensions.extras.subscript]
enable = true
{{< /code-toggle >}}

#### Passthrough

{{< new-in 0.122.0 >}}

Enable the passthrough extension to include mathematical equations and expressions in Markdown using LaTeX or TeX typesetting syntax. See [mathematics in Markdown] for details.

[mathematics in Markdown]: content-management/mathematics/

#### Typographer extension
#### Typographer

The Typographer extension replaces certain character combinations with HTML entities as specified below:

Expand Down
2 changes: 2 additions & 0 deletions data/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,8 @@ config:
escapedSpace: false
definitionList: true
extras:
delete:
enable: false
insert:
enable: false
mark:
Expand Down

0 comments on commit 6677a30

Please sign in to comment.