Menu icon Foundation
Formatting code snippets

Does Foundation include any way to format code snippets like in the Foundation documentation: http://foundation.zurb.com/docs/components/accordion.html

I've created the css to style it as shown in the above link, but is there a quick way to replace all the characters that need escaping, add the spans and classes in the correct location?

Otherwise I will have to manually go through each code snippet replacing/inserting where appropriate.

Thanks,

code snippets

Does Foundation include any way to format code snippets like in the Foundation documentation: http://foundation.zurb.com/docs/components/accordion.html

I've created the css to style it as shown in the above link, but is there a quick way to replace all the characters that need escaping, add the spans and classes in the correct location?

Otherwise I will have to manually go through each code snippet replacing/inserting where appropriate.

Thanks,

Wing-Hou Chan over 5 years ago

Hey David!

Foundation doesn't come with a syntax highlighter. As you said you can manually highlight your syntax with spans and CSS.

However you could try one of the many syntax highlighters available.

Here is a Google search link: https://www.google.co.uk/?gws_rd=ssl#q=syntax+highlighter

David Barker about 5 years ago

Thanks!

On another note a lot of the syntax highlighters require you to escape certain html characters. I came across this tool that can automate the process:

http://www.htmlescape.net/htmlescape_tool.html