0

I want to add some 'c' and 'assembly' code in my post but the characters end up not being escaped, see the pictures below please:

A C code that I put into the editor:

#include <cstdio>

Results after publishing/preview in:

enter image description here

And here a bit assembly:

main:
        push    {r4, lr}
        ldr     r3, .L4
        ldr     r2, .L4+4
        ldr     r1, [r3]
        ldr     r2, [r2]
        ldr     r0, .L4+8
        bl      printf
        mov     r0, #0
        pop     {r4, lr}
        bx      lr

results in:

enter image description here

How can I fix this?

9
  • How are you adding the code to the post? A block, shortcode, raw HTML? Commented Aug 11, 2022 at 11:49
  • I'm not seeing any code to debug in your question, can you edit the question to include it?
    – Tom J Nowell
    Commented Aug 11, 2022 at 12:03
  • @JacobPeattie I just copy it from my IDE and then paste it in wordpress editor
    – DEKKER
    Commented Aug 11, 2022 at 12:08
  • @TomJNowell I added the code as text (was img before)
    – DEKKER
    Commented Aug 11, 2022 at 12:08
  • 1
    @SallyCJ Yes I just found out I am using "Crayon Syntax Highlighter" plugin
    – DEKKER
    Commented Aug 11, 2022 at 20:55

1 Answer 1

0

Sorry for bothering you all, I found out there is an option in the syntax highlighter plugin that I am using "Crayon Syntax Highlighter" and by checking the "decode HTML entities in code" in the plugin it now shows correctly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.