We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Is there an easy wy to allow users to submit a code block?

How Do I?

Bill the Grue's avatar
Bill the Grue
162 posts
7 years ago
Bill the Grue's avatar Bill the Grue

Hello all

I would like to allow my users to submit a block of code from a front-end form. I want the submission to respect whitespace, tabs, and all the various characters one might find in a code block. Extra points if a user can choose which language so syntax highlighting might work.

I’m hoping for something like this:

https://highlightjs.org/

Any ideas?

Thank you in advance

Warmly,

Bill

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

Sure thing, Bill! Mentioned it in Slack, but posting here for Google-ability. You can use bbcode-like code blocks, and specify the syntax grammar to use for highlighting purposes. This works great with drop-in highlighters like highlight.js but you have options! See the docs section: Syntax Highlighting.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.