Title: Syntax error for C++ coding
Last modified: November 18, 2019

---

# Syntax error for C++ coding

 *  [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/)
 * Hi there,
    I just install the enlighter for my internal blog (wordpress) for 
   highlighting C++ code, here is my block
 *     ```
       <pre class="EnlighterJSRAW" data-enlighter-language="cpp">
       vector<int> A, B;
       int C = 13; // constant 
   
       for (int i=1; i<=10; i++) {
         A.push_back(i);
       }
       B.resize(A.size());
       std::transform(A.begin(), A.end(),B.begin(),std::bind(std::plus<int>(), std::placeholders::_1, C));
   
       for (int i=0; i<A.size(); i++) {
         std::cout << A[i] << " ";
       }
       </pre>
       ```
   
 * I find that the C++ syntax with
 * > <int> and [i] and <A.
 *  mess up with the html tags so the page formatted all wrong.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsyntax-error-for-c-coding%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12149302)
 * which editing mode (Gutenberg, TinyMCE, Gutenberg-Plain/HTML, TinyMCE-Plain-HTML)
   did you use ?
 *  Thread Starter [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12150842)
 * I use TinyMCE-Plain-HTML. I find that it is the “<>” in C++ syntax cause the 
   issue. If I put spaces between “<” and “>”, e.g. `vector< int >`, it fix the 
   issue. However, it is quite troublesome to modify the code by adding space everywhere
   before parsing them into my page.
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12150922)
 * the problem is that you’re using html brackets within the code which are interpreted
   as regular html code by WordPress/your webbrowser.
 * in case you want to write html code you have to escape the code on your own!
 * The Enlighter plugin includes editing plugins for TinyMCE and Gutenberg (visual
   mode) which also take care of the html characters and escapes them automatically.
 * maybe you want to use shortcodes
 *  Thread Starter [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12155379)
 * Thanks for your reply. I try to use TinyMCE (visual mode) but it still doesn’t
   work. I still have to add space in between <> to make it work. Any idea?
 *  Thread Starter [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12155416)
 * By the way, I try Gutenberg (visual mode) as well, it doesn’t work either.
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12156347)
 * did you use the “code insert” button / gutenberg blocks ?
 * i assume that this is a third party issue – the editing plugins are working fine
 *  Thread Starter [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12156716)
 * Yes, I do see the code insert button. I don’t know how to debug it if it is third
   party issue 🙁
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12156721)
 * disable all other plugins and test if it’s working. then re-enable the plugins
   step-by-step
 *  Thread Starter [evlee](https://wordpress.org/support/users/evlee/)
 * (@evlee)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12156827)
 * Thanks. I found it. This plugin conflicts with WPGlobus.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Syntax error for C++ coding’ is closed to new replies.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [evlee](https://wordpress.org/support/users/evlee/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-for-c-coding/#post-12156827)
 * Status: not resolved