HTML encoding character
-
Hi,
I have a hard time to make my programmation code stay the way I saved it.
Anytime, I use [code]... => ...[/code], this line is transformed into [code]... => ...[/code] and that is not improving along the time because character ‘&’ is converted into ‘&’ and repetitively which give [code]... => ...[/code]…
I know when I use the command ctrl+C and ctrl+v the article edition changes the characters, so I stopped using them. But it seems the code changes without my intervention… which is frustrating.
Do you have any solution ? to display my code on wordpress.com ?
Thank you for reading me.
The blog I need help with is: (visible only to logged in users)
-
My page is that one https://cifrenblog.wordpress.com/2016/09/30/part-2-create-your-own-edit-form-on-panels-and-eck-module/
If you go have a look to the code samples, the encoding is messed up.
I suppose I won’t have the choice but to use that kind of website to add up my code…
Embed Gist does the same but it is limited, no height control and it will display all files from it…
Thank you for the help, I appreciate :)
-
Thanks @cifren8x, can you also give us a sample of your original code?
Also, you could try using the older editor to see if you have the same issue there:
https://cifrenblog.wordpress.com/wp-admin/edit.php -
There is nothing special in my code
[code]
[code language="php"]
<?php
$lol = array("plop" => "hello");
[/code]
[/code]Any ‘ ” ‘ and ‘ > ‘ would be transformed into ‘ & amp ‘.
I didn’t see it before but my first message code, in this thread, has been replaced too… but in the way I would have liked on my blog lol
-
Can you try just this?
[code language="php"] <?php $lol = array("plop" => "hello"); [/code]Or were you trying to nest the code section?
-
I was trying to display my code in this section sorry. You can remove the first one.
Blog’s article :
“
Something I explain
[code language="php"]
// My code
[/code]
A sentence…
” -
@cifren8x that is working for me. :/
Is your code being stripped? If so can you copy all of it over to an outside thing like pastebin or cloudup and let me try exactly what you’re using on my side?
Also, so that I can try to duplicate this, are you using wp-admin or https://wordpress.com/post ? And are you using the visual editor or the HTML editor?
-
I am mainly using https://wordpress.com/post, i am not sure if I did edit in wp-admin, but I would say no.
For my understanding, in https://wordpress.com/post, when I edit a post, characters like ‘ ” ‘ and ‘ > ‘ are transformed. You can do it yourself just by pressing ctrl+z (not copy-paste like I said before), on my computer the characters change instantly. Do you the issue too ?
Like I said, I stopped to use ctrl+z, but the characters, after a while, changed anyway in my post. (https://wordpress.com/post/cifrenblog.wordpress.com/782)
I am using the basic free version, nothing more, I didn’t add anything (I am not sure how to do it if we can).
I’ll do the test, I will edit :
– https://cifrenblog.wordpress.com/2016/09/30/part-2-create-your-own-edit-form-on-panels-and-eck-module/ this one with wp-admin
– https://cifrenblog.wordpress.com/2016/09/16/create-your-own-edit-form-on-panels-and-eck-module/ this one with “post”And I will watch them, to see if they behave the same way.
If you watch the post, you can access the code directly on Github, the filename are given, so you can retrieve them quickly. Then you can compare. Mainly the issue happens on special characters only: ” > < &
-
Here you can find the articles, part 1 and part 2. I added the broken articles too.
https://cloudup.com/cPIMA5-JLeAI also repaired like I said both of those articles. (see link above)
-
It seems definitively better when I press Ctrl+Z, the issue disappear.
I will add another article next Friday, If I see an issue I’ll come back here.
Thank you for your help :)
-
Actually, ctrl+z (“undo” in WYSIWYG bar does the same) is still destroying the code, on https://wordpress.com/post, on ‘visual’. ‘html’ mode is fine with this.
I modified lightly the articles in ‘visual’ mode, if the issue will come back by itself in a little while, on the same articles mentioned before.
-
Anytime I add & ” < > in [code][/code] the characters get changed only on ‘visual’ mode.
I did some tests, the characters are displayed well in ‘html’ edit mode even when ‘visual’ mode is messed up,
In ‘visual’ mode that is not working, which is the same than the public display. -
On that part, I have to say I am not sure… I would say, at some point, I created an article and it would seem the article got changed by itself after a while, but on last editions I did, nothing happened. Could be the system or me who has done undo… I am not sure… But the future will tell us :)
For now only undo does it, if I see otherwise, I’ll tell you.
- The topic ‘HTML encoding character’ is closed to new replies.