forgejo/modules/markup/markdown
Gusted fad28141fa fix: render link in heading correctly in TOC (#6853)
- When you use a link in a heading such as `# [Text](link)` (instead of the conventional `# Text`) the TOC should only show `Text` and not `[Text](link)`.
- Use the `mdutil.Text` to only get the text from actual text nodes and not the text that was provided in the markdown input.
- Regression of e2fddcf681
- Resolves forgejo/forgejo#6847
- Added integration test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6853
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-02-08 13:34:09 +00:00
..
callout fix: remove softbreak from github legacy callout 2024-12-04 22:08:38 +01:00
math chore: Remove WithXXXParser 2025-01-31 16:22:29 +01:00
util chore: fix deprecation 2024-11-02 16:39:27 +01:00
ast.go chore: Remove IsXXX 2025-01-31 16:22:29 +01:00
color_util.go feat: support color dots for 4 character hex. 2024-11-02 13:37:14 +01:00
color_util_test.go feat: support color dots for 4 character hex. 2024-11-02 13:37:14 +01:00
convertyaml.go Improve Wiki TOC (#24137) 2023-04-17 15:05:19 -04:00
goldmark.go refactor: remove redundant err declarations (#32381) 2024-11-05 09:33:15 +01:00
markdown.go [CHORE] Remove github.com/yuin/goldmark-meta 2024-07-07 03:18:13 +02:00
markdown_test.go Remove automatic alt text in markdown image rendering 2025-01-31 21:22:00 +00:00
meta.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
meta_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
prefixed_id.go Refactor to use UnsafeStringToBytes (#31358) 2024-06-16 13:42:58 +02:00
renderconfig.go Fix task list checkbox toggle to work with YAML front matter (#25184) 2023-06-13 14:44:47 +08:00
renderconfig_test.go Improve Wiki TOC (#24137) 2023-04-17 15:05:19 -04:00
toc.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
transform_codespan.go chore: fix deprecation 2024-11-02 16:39:27 +01:00
transform_heading.go fix: render link in heading correctly in TOC (#6853) 2025-02-08 13:34:09 +00:00
transform_image.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-05-05 08:38:16 +01:00
transform_link.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-05-05 08:38:16 +01:00
transform_list.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-05-05 08:38:16 +01:00