Closed adamhollett closed 7 years ago
Hi @admhlt . Well, right now you could write your custom parser as expained in the Readme. But it is clearly a bug. I'll take a look as soon as possible.
Thanks
Thanks! I'll find a solution for myself in the meantime. The app's not in production so there's no rush.
Hey @admhlt . This commit in master should fix it. Please, confirm that it works in your case and then I'll release a new version with the fix to rubygems :)
Amazing! Yeah, this has fixed the issue for me. Thanks a lot!
Great! Released as 0.1.1 :+1:
Hi @waiting-for-dev!
I'm building a Rails app that parses and displays Jekyll-style pages: Markdown files with YAML front matter. I'm using this gem to parse the front matter from the pages into
@page.data
and I assign the rest of the content to@page.content
.A problem comes up when any of my pages have a sequence of three hyphens in them
---
. FrontMatterParser will always read until the last sequence of---
in the file instead of stopping at the---
after the front matter like I expect it to.For example, if I have this file:
The parser works as expected; I get
@page.data = { title: 'About email notifications' }
and@page.content = 'This is the page about email notifications'
.But if the file has a sequence of three hyphens:
The parser gives me
@page.data = { title: 'About email notifications' }
but@page.content = 'Your credit card is about to expire!'
Is there a way to make the parser less greedy, and stop it from gobbling all my page content if the content contains sequences of hyphens?