themsaid / wink

A Laravel-based publishing platform
MIT License
2.9k stars 383 forks source link

Configurable markdown parser #348

Closed lukeraymonddowning closed 1 year ago

lukeraymonddowning commented 2 years ago

Currently, there is no way to configure markdown parsing. This can prove to be a problem when you want to add extensions or custom settings to markdown parsing.

With this PR, we add the ability to customise the functionality behind $post->content using the Wink::parseMarkdownUsing method. This method accepts a closure, which receives a string (the body of the post) and should return a string or HtmlString.

This will override the default parser and use the custom method whenever $post->content is called.

This PR also adds a couple of tests in order to make a start adding tests for functionality in Wink.

Kind Regards, Luke

tvbeek commented 2 years ago

Maybe it is an idea to add a github action to run the test.

themsaid commented 1 year ago

I'm ok with the feature but I don't want to merge the other changes. Feel free to re-open the PR with only the code necessary to implement the feature.

Thank you. And sorry for taking that long to check :)