Wrong rendering from sourcecode tag in C code
-
I use the sourcecode tag to enclose source code in my blog. But in my code I use < and > quite often. The sourcecode tag renders these in an awkward way. I learned about sourcecode tag from here:
Here: https://en.forums.wordpress.com/topic/pasting-source-code?replies=12
I use the ‘cpp’ language. The output is full of </xyz> when I write a template or a cast function – all these are typical features of C++. It seems that sourcecode has a bug in its C++ implementation then. Any ideas what to do? -
Can we get a link to your wordpress.COM blog? And if you are hosted here, consider linking it in your user name as explained in the sticky, 8 Things, at the top of the forums.
-
Okay, I updated my profile :)
Now have a look at a post with C++ source code: http://onyourshore.wordpress.com/2008/11/28/converting-data-to-and-from-stdstring/ -
What are you using to write the sourcecode? Are you pasting in from Word or something? Do you write directly into the Post box? Or use Notepad or something?
-
First, I switch to html mode in WordPress. Then I copy and paste the code from the source code editor from the IDE I use. Does this make any difference?
The problem seems to come from the templates. A template in C++ has the form <something>, and I think the sourcecode tag can’t properly render these? -
-
- The topic ‘Wrong rendering from sourcecode tag in C code’ is closed to new replies.