Commit graph

17 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
24cc25552f Fix auto generated header ids so they don't contain e.g. hyperlink destinations (note)
This makes the header ids match the newly added dt ids.

Also make sure newlines are preserved in hooks' `.PlainText`.

Fixes #13405
Fixes #13410
2025-02-17 12:23:49 +01:00
Bjørn Erik Pedersen
6aa72acaf9 Fix render hook's PlainText with typographer extension enabled
Fixes #13286
Fixes #13292
2025-01-22 12:49:25 +01:00
Bjørn Erik Pedersen
9885e7020d Improve assert 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
91101d24f2 Improve assertions 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
637995ba8f Also handle inline HTML comments 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
f1de5d2a04 Do not warn on potentially unsafe HTML comments when unsafe=false
We will still not render these comments, so from a safety perspective this is the same, but HTML comments are very common also inside Markdown and too useful to throw away.

Updates #13278
2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
d4de780edc Fix extra newline/paragraphs issue with .RenderShortcodes
Fixes #13051
2024-11-16 17:51:11 +01:00
Andreas Deininger
e79ee0d516
markup/goldmark: Fix typo in error message 2024-11-13 10:12:26 +01:00
Joe Mooring
2b97a2a8bf markup/goldmark: Improve the raw HTML omitted warning
Closes #13023
2024-11-07 23:00:09 +02:00
Bjørn Erik Pedersen
4faaaf9c2f markup: Goldmark log "Raw HTML omitted" warning also for inline HTML
Fixes #13013
2024-11-05 11:40:42 +01:00
Bjørn Erik Pedersen
62a96cef7f markup/goldmark: Add warning (using Warnidf) on Goldmark <!-- raw HTML omitted -->
Fixes #12997
2024-11-03 14:17:10 +01:00
Bjørn Erik Pedersen
1f23b4949c Fix some RenderShortcodes error cases
This issue fixes two cases where `{{__hugo_ctx` artifacts were left in the rendered output:

1. Inclusion when `.RenderShortcodes` is wrapped in HTML.
2. Inclusion of Markdown file without a trailing newline in some cases.

Closes #12854
Updates #12998
2024-11-03 13:33:31 +01:00
Bjørn Erik Pedersen
6d97ee711e Make all renderhook Text methods return template.HTML 2024-08-31 21:05:58 +02:00
Joe Mooring
8efc75b73f markup/goldmark: Add the Hugo Goldmark Extras "delete" extension
With Goldmark v1.7.1 and earlier, the Goldmark "strikethrough" extension was
triggered by wrapping text within a pair of double-tilde characters. With
Goldmark v1.7.2 and later, to provide full GFM compatibility, the Goldmark
"strikethrough" extension is triggered by wrapping text within a pair of
single- or double-tilde characters.

This change created a conflict with the Hugo Goldmark Extras "subscript"
extension.

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

Closes #12597
2024-06-18 18:56:20 +02:00
Joe Mooring
ca9a77ef92 markup/goldmark: Support extras extension
Enables inclusion of these HTML elements in Markdown:

- Inserted Text (++inserted++)
- Mark Text (==marked==)
- Subscript (H~2~O)
- Superscript (1^st^)
2024-05-10 22:32:02 +02:00
Bjørn Erik Pedersen
982d9513e7
testing: Simplify some integration tests 2024-01-28 22:17:22 +01:00
Bjørn Erik Pedersen
2a0329423c
testing: Rename integration_test.go to PACKAGE_integration_test.go
Primary motivation making them easier to find in the code editor.
2024-01-28 11:41:59 +01:00
Renamed from markup/goldmark/integration_test.go (Browse further)