Logo
Explore Help
Sign In
actions/mark
1
0
Fork 0
You've already forked mark
mirror of https://github.com/kovetskiy/mark.git synced 2025-06-07 15:02:42 +08:00
Code Issues Packages Projects Releases 1 Wiki Activity
mark/testdata/header.md

13 lines
67 B
Markdown
Raw Normal View History

fix: Title not being extracted when not on the first line While a page with a macro is processed, having a macro leaves an unclean buffer for further processing steps, including title extraction. The problem seems to come from `ExtractMeta`: as it runs through the metadata, it hits the first line of the macro but since it doesn't look like a complete Metadata (e.g. matching either `\[\]:\s*#\s*\(([^:]+):\s*(.*)\)` or `<!--\s*([^:]+):\s*(.*)\s*-->` in https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L37:L38, it will break the loop in https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L61 and return the final document as: ``` Template: ac:children Style: h2 Excerpt: none Page: TestSpace:Test Reverse: false All: true --> :children: ``` This then goes into `ExtractDocumentLeadingH1` which doesn't find a match for the regex `^#[^#]\s*(.*)\s*\n`, returning an empty title since the title is not on the first line. This commit, while it doesn't fix the unclean document, fixes the regex to properly find the title. Closes #214
2023-01-25 10:52:00 +01:00
rollback #53 because of #63, add tests
2021-02-02 17:12:08 +03:00
# a
## b
### c
#### d
##### e
f
=
g
-
Feat: Use custom heading anchors Confluence Anchors are case-sensitive.
2024-10-22 10:50:06 +02:00
# This/is some_Heading.yml
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 57ms Template: 2ms
闽ICP备 2020023186号-1
  
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API