Bjørn Erik Pedersen
494e88abf6
markup/goldmark: Fix panic on empty Markdown header
...
Fixes #13416
2025-02-18 11:12:39 +01:00
Bjørn Erik Pedersen
85c1727748
markup/goldmark: Fix panic on stray attribute nodes
2025-02-17 17:19:53 +01:00
Bjørn Erik Pedersen
641403f7de
Fix Position for passthrough hooks
...
Fixes #13406
2025-02-17 12:23:49 +01:00
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
157d3703c3
Add autoID for definition terms
...
Fixes #13403
See #11566
Co-authored-by: Joe Mooring <joe@mooring.com>
2025-02-16 20:55:27 +01:00
Joe Mooring
e08d9af21e
markup/goldmark: Trim space from blockquote render hook text
...
Closes #13302
2025-01-24 19:58:45 +01:00
Patrice Chalin
f704d75699
markup/goldmark: Fix typo in func comment
2025-01-22 14:57:24 +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
cfa0801815
Fix NPX issue with TailwindCSS v4
...
This allows the `tailwindcss` CLI binary to live in the `PATH` for NPM-less projects.
Fixes #13221
2025-01-07 13:12:08 +01:00
Joe Mooring
2db43f841c
markup/highlight: Remove noHl option
...
Closes #9885
2024-12-31 15:46:46 +01:00
Bjørn Erik Pedersen
ec0caaec7c
markup/highlight: Add wrapperClass option
...
The need comes from Tailwind's typography plugin. There's currently no way to turn that off outside of the markup, see https://github.com/tailwindlabs/tailwindcss-typography/pull/363
2024-12-25 19:31:47 +01:00
Joe Mooring
34373407b7
markup/goldmark: Fix blockquote render hook text parsing
...
Fixes #12913
Fixes #13119
2024-12-10 09:43:33 +01:00
Joe Mooring
54398f8d57
tpl/tplimpl: Escape Markdown attributes in render hooks and shortcodes
2024-12-09 17:58:57 +01:00
Joe Mooring
b529859008
markup/tableofcontents: Cast Fragments.ToHTML args to int
...
Closes #13107
2024-12-04 21:37:06 +01:00
huajin tong
fc3d1cbadb
Fix some typos
2024-11-28 11:20:02 +01:00
Bjørn Erik Pedersen
d4de780edc
Fix extra newline/paragraphs issue with .RenderShortcodes
...
Fixes #13051
2024-11-16 17:51:11 +01:00
Bjørn Erik Pedersen
588c9019cf
deps: Upgrade github.com/yuin/goldmark v1.7.4 => v1.7.8
...
Closes #12958
2024-11-14 14:31:04 +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
6cf23bf882
markup/goldmark: Only log Raw HTML omitted WARN on block entering
...
Updates #12997
2024-11-04 10:13:53 +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
Joe Mooring
1158e63072
markup/goldmark: Change default cell alignment in table render hook
...
Change the default table cell alignment from "left" to an empty string.
Closes #12886
2024-09-30 08:44:14 +02:00
Bjørn Erik Pedersen
66a3a11001
Fix stray end p tag in Obsidian callout titles
...
Also remove test references to deprecated funcs now in ERROR.
Closes #12828
2024-09-05 12:12:24 +02:00
Bjørn Erik Pedersen
504a23184f
markup/goldmark/blockquotes: Improve some tests
2024-09-01 18:25:10 +02:00
Bjørn Erik Pedersen
e651d29801
Add support for Obsidian type blockquote alerts
...
* Make the alert type parsing more flexible to support more types
* Add `AlertTitle` and `AlertSign` (for folding)
Note that GitHub will not render callouts with alert title/sign.
See https://help.obsidian.md/Editing+and+formatting/Callouts
Closes #12805
Closes #12801
2024-09-01 18:12:26 +02:00
Bjørn Erik Pedersen
469124823c
Rename hstring.RenderedHTML => hstring.HTML
...
And add a comment about why it exists.
2024-09-01 10:04:20 +02:00
Bjørn Erik Pedersen
6d97ee711e
Make all renderhook Text methods return template.HTML
2024-08-31 21:05:58 +02:00
Bjørn Erik Pedersen
f738669a4d
Add Markdown render hooks for tables
...
Fixes #9316
Fixes #12811
2024-08-31 17:21:31 +02:00
Bjørn Erik Pedersen
d72607adb9
markup/goldmark/blockquotes: Fix handling of lower/mixed case GitHub alerts
...
Fixes #12767
2024-08-14 18:09:04 +02:00
Bjørn Erik Pedersen
bef9214e11
Fix nilpointer regression with empty blockquotes
...
Fixes #12756
2024-08-13 11:46:25 +02:00
Bjørn Erik Pedersen
665ac949bd
markup: Add blockquote render hooks
...
Closes #12590
2024-08-07 18:28:23 +02:00
Bjørn Erik Pedersen
4c162deb03
markup/goldmark/codeblocks: Simplify codeblcok hook code
2024-08-07 18:28:23 +02:00
Bjørn Erik Pedersen
c6227f1d85
Add render hooks for inline and block passthrough snippets
...
Fixes #11927
2024-08-07 18:28:23 +02:00
Bjørn Erik Pedersen
e1317dd322
Add css.TailwindCSS
...
Closes #12618
Closes #12620
2024-06-25 15:48:02 +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
Bjørn Erik Pedersen
e2d66e3218
Create pages from _content.gotmpl
...
Closes #12427
Closes #12485
Closes #6310
Closes #5074
2024-05-14 13:12:08 +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
509ab08c1b
markup/goldmark: Fix data race in the hugocontext wrapper
...
The window for this to happen is very small, but it has been reported by Go's race detector (-race flag) in a tests once.
2024-04-22 19:10:15 +02:00
Bjørn Erik Pedersen
df11327ba9
Pass .RenderShortcodes' Page to render hooks as .PageInner
...
The main use case for this is to resolve links and resources (e.g. images) relative to the included `Page`.
A typical `include` would similar to this:
```handlebars
{{ with site.GetPage (.Get 0) }}
{{ .RenderShortcodes }}
{{ end }}
```
And when used in a Markdown file:
```markdown
{{% include "/posts/p1" %}}
```
Any render hook triggered while rendering `/posts/p1` will get `/posts/p1` when calling `.PageInner`.
Note that
* This is only relevant for shortcodes included with `{{%` that calls `.RenderShortcodes`.
* `.PageInner` is available in all render hooks that, before this commit, received `.Page`.
* `.PageInner` will fall back to the value of `.Page` if not relevant and will always have a value.
Fixes #12356
2024-04-15 09:49:57 +02:00
Eitan Adler
bf0b140364
all: Fix duplicate words in comments
2024-04-11 09:31:33 +02:00
Christian Oliff
17765a7451
all: Typo fixes
2024-04-11 09:23:17 +02:00
Joe Mooring
c837f36ab4
markup/asciidocext: Add Level to Heading struct
...
Closes #12291
2024-03-21 19:14:49 +01:00
Bjørn Erik Pedersen
ba03114aa9
deps: Upgrade github.com/gohugoio/hugo-goldmark-extensions/passthrough v0.1.0 => v0.2.0
2024-03-16 11:50:11 +01:00
Christian Oliff
78178d0c2a
all: Typo fixes
2024-03-15 17:25:52 +01:00