Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow custom before/after in pages #27

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

GerkinDev
Copy link

@GerkinDev GerkinDev commented Jun 6, 2024

Closes #22

Currently the file is read from disk. The problem I had was that referencing the leaf directly sometimes referenced to the previous selected page, not the new one, since the view was not updated yet. If you know how to retrieve the in-memory file content, I would gladly update my PR

baseContent: string,
): { before: string; after: string } => {
const match = baseContent.match(
/^(?<frontmatter>---\n.*?\n---\n)?(?:(?<before>.*?)\n)?(?<tagpage>%%\ntag-page-md.*?tag-page-md end\n%%)(?:\n(?<after>.*?))?$/s,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frontmatter & tagpage groups do not need to be captured, but I used them as a way to comment parts of the pattern

@mjsumpter mjsumpter self-requested a review July 30, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Allow other content in tag page
1 participant