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

How disable line wrap in front matter (for Hugo or Jekyll) #92

Closed
apoutchika opened this issue Jul 31, 2020 · 6 comments · Fixed by #103
Closed

How disable line wrap in front matter (for Hugo or Jekyll) #92

apoutchika opened this issue Jul 31, 2020 · 6 comments · Fixed by #103

Comments

@apoutchika
Copy link

Hi,

When use front matter in markdown file :

---
Author: Test
Description: Test
---

# Test

If i try to update or add parameters in front matter, Pencil remove all new line :

Try to add Title Between Autor and Description :

--- Author: Test Title Description: Test ---

# Test

How to disable this only for this part ?

@apoutchika apoutchika changed the title How disable line wrap for front matter (for Hugo or Jekyll) How disable line wrap in front matter (for Hugo or Jekyll) Aug 8, 2020
@antgel
Copy link

antgel commented Nov 8, 2020

Thanks for opening this. I too would love to know. Currently I'm manually disabling Pencil, and it's quite annoying.

@alerque
Copy link
Member

alerque commented Nov 9, 2020

I don't think VIM supports region based wrap settings at all. If anybody knows of any language or plugin that supports this please mention it here and we can look into how they did it, but off the top of y head this may not be possible.

@reedes
Copy link
Collaborator

reedes commented Mar 15, 2023

I've recently started using Jekyll and see that it's using "yaml" prefixed highlight groups in the markdown headers.

These highlight groups can be identified (from the syntax files) and added to the pencil blacklist, to ensure that autoformat won't be enabled if entering insert mode in hard line break mode.

If I get a chance, I'll dig into this further.

@antgel
Copy link

antgel commented Mar 30, 2023

@reedes Looking forward to hearing what you find; I just found this issue and I didn't know what I had been doing wrong! By the way, why is Pencil doing this at all? What's the intention? Is it that it thinks the lines should be wrapped into one paragraph because there is no blank line between them?

reedes added a commit that referenced this issue Apr 3, 2023
Blacklist support Jekyll front matter #92
@reedes
Copy link
Collaborator

reedes commented Apr 3, 2023

A minor error in my regex. I'll look at getting it fixed in the next few days and will generate a fresh pull request.

(The recent merged request shouldn't break anything, so no need to revert it.)

@reedes reedes reopened this Apr 3, 2023
reedes added a commit that referenced this issue Apr 3, 2023
Unnecessary regex modifier on my recent change #92
@reedes reedes closed this as completed Apr 9, 2023
@antgel
Copy link

antgel commented Apr 9, 2023

@reedes Thanks so much for this, amazing how such a small code change can have such a big impact!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants