-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix #30, bug where the package cannot properly parse a file that contains Markdown code blocks with front matter in them #38
Conversation
Okay I refactored the code to use an improved version of what I used for the Hyde framework. I'm converting everything to arrays, which may be a bit inefficient but I think it makes it much more readable and understandable. I also added two more tests. Let me know if its okay or if I should change anything else. This is my first community PR so I'd love to get feedback for the many more I hope to make :) |
Let me know if there is anything else I can improve! Also, @freekmurze, I really want to thank you for taking the time to give me such great feedback and helping me become a better developer! This is my first time contributing to a community package and thanks to you I feel like I have learned a lot! |
Okay, pushing the commits now. I made it all in separate commits as I think that makes it easier to follow. I assume you will probably squash them before merging. As you can see I did not change the double quotes to single quotes as I wanted to await your input on the concern I placed as a comment in the first change conversation. |
Thank you! |
That's super cool! Thank you! |
This PR fixes #30
The PR is fully backwards compatible as it does not change the existing parser, but instead adds a new one:
YamlFrontMatter::markdownCompatibleParse()
which uses code by https://github.com/eklausme (I hope this is okay, I'm happy to add you as a co-author if you see this!Before:
![image](https://user-images.githubusercontent.com/95144705/160793264-15d59ea1-44a1-4019-9b01-90e41b06aa75.png)
After:
![image](https://user-images.githubusercontent.com/95144705/160793131-0905fb1a-b67b-4e25-b790-b6f7086c70fb.png)
The source markdown used for the example: (with the inline backticks replaced)