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 to parse markdown field #42

Closed
zenonyip opened this issue Dec 19, 2019 · 1 comment
Closed

How to parse markdown field #42

zenonyip opened this issue Dec 19, 2019 · 1 comment

Comments

@zenonyip
Copy link

if i set a long text field as markdown,how to parse this to html?

@pgrigoruta
Copy link
Contributor

pgrigoruta commented Jan 6, 2020

Hi @zenonyip , check https://github.com/contentful/rich-text.php#rendering , using the Renderer should to the trick:

$entry = $client->getEntry('ENTRY_ID');
$renderer = new \Contentful\RichText\Renderer();
echo $renderer->render($entry->get('FIELD_NAME'));

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

No branches or pull requests

2 participants