Posting Code Snippets
-
Asked a Happiness Engineer this but figure I post my question in here as well.
I’m having some problems using the [code] tag in my posts. The code tag is discussed here: https://en.support.wordpress.com/code/posting-source-code/ . It works fine with Java but when you post languages like XML or R characters will be reformatted when you switch between 'Visual' and 'html' sections of making a blog post.
For example, If I post this in html:
[code language='xml']
<beans xmlns='http://www.springframework.org/schema/beans'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:camel='http://camel.apache.org/schema/spring'
xsi:schemaLocation='
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd'><camelContext xmlns='http://camel.apache.org/schema/spring'>
</camelContext>
</beans>
[/code]Then switch back to 'Visual' view to continue typing my post from the visual editor. Eventually the Illegal html characters will be reformatted(i.e. < become <). Is this avoidable is there another tag I can use?
The blog I need help with is: (visible only to logged in users)
- The topic ‘Posting Code Snippets’ is closed to new replies.