jensjns / acf-markdown-field

WordPress plugin thats adds a markdown-editor field to ACF
GNU General Public License v2.0
18 stars 3 forks source link

How to correct output the markdown field? #1

Open stepanselyuk opened 9 years ago

stepanselyuk commented 9 years ago

Hello, I've installed ACF and acf-markdown-field plugin, added the markdown field and see it on the edit page properly. I've put in the field a some markdown text, and on in the main editor added [acf field="markdown"], so I see the text on the page, but it is not processed, just markdown as plain text.

How to make output for the users properly?

stepanselyuk commented 9 years ago

I tried to install the Markdown Extra plugin as suggested on http://support.advancedcustomfields.com/forums/topic/add-markdown-support-in-custom-fields/ but without success.

jensjns commented 9 years ago

Hello @stepanselyuk Thanks for trying out this plugin! This field is in a way just a fancy textarea that helps when you write markdown, preview, fullscreen and so on. To display the content as html on your frontend you will need to parse it with a markdown-parser (take a look at https://github.com/chjj/marked).

If you also want syntax-highlighting for code-blocks I can recommend https://highlightjs.org/

graham73may commented 7 years ago

Just to throw a different markdown parser into the mix, I'm using Parsedown (http://parsedown.org/) and passing the fields content to it before outputting it - parsing it in PHP instead of JS.

Also doing syntax highlighting with highlightjs as jensjns said.