Why not wrapping SQL code in my this post?
-
Hello my guys and friends :-),
Why not wrapping the 3rd count backwards SQL codes into label [code] ... [/code] in my this post https://quanwenzhao.wordpress.com/2020/01/31/classic-pagination/.
Actually I really inserted a couple of lable [code] ... [/code] in the editable page of that blog post. As you can see other code labels are all normal.
I’m not sure why the 3rd count backwards code label doesn’t always take effect?
Could you help me to solve it? Thanks in advance!
Best Regards
Quanwen ZhaoThe blog I need help with is: (visible only to logged in users)
-
Hi there!
It looks like you’re still using the Classic editor, I’d suggest you give the new Block editor a try and use the Code Blocks to display your code. Have a look:
-
Hello fresatomica :-),
Thanks, I’ll try the new Block editor.
But in the classic editor I’ve found “paragraph” and “preferred” label. Usually we’re in the model of paragraph (default). In general I firstly wrap SQL code into “preferred” and secondly add [code] ... [/code] onto the before and after of SQL code.
So what’s the difference between “paragraph” and “deferred”?
Best Regards
Quanwen Zhao -
@quanwenzhao are you wrapping in pre-formmatted first and then code? You shouldn’t have to do that. Just code should work.
Pre-formatted is OK for code sometimes, but it can still strip out some of your code if you’re not careful. It just applies a monospaced font, and it pays attention to where you add extra spaces and what not.
A paragraph will take extra spaces out for you, assuming you didn’t mean to have them there. So we recommend pre-formatted for poetry and what not.
The code block also adds monospaced and minds your extra spaces, but it should also keep your code in place. We recommend the code block, or code tags, for code.
-
Hello supernovia :-),
Sorry, I mentioned “preferred” on my previous reply is “preformatted”.
Now I eliminate “preformatted” section and only reserve the tags of code. But I never see my real code style such as line “1, 2, 3, and …” on the special SQL code.
Please take a look at the following two images:
https://quanwenzhao.files.wordpress.com/2020/02/code_tag_sql_1.png
https://quanwenzhao.files.wordpress.com/2020/02/code_tag_sql_2.png
Best Regards
Quanwen Zhao -
-
Hello fstat :-),
I’ve removed and then inserted that pieces of SQL code to my post again and again (more than one time). So I think that my this problem is so weird.
Have you really just added tags [code] ... [/code] into these SQL code in your test page?
Now I have to manage to switch the New Block Editor to re-update my post.
Best Regards
Quanwen Zhao -
Hmm, I’m not sure what’s breaking it in your original post.
Instead of deleting the code and adding it again, try creating a brand new post and paste the content there.Let us know if that works.
-
Hello fresatomica :-),
This time I create a private test new post and add SQL code meanwhile observing its display effect. New test post is able to show right code block format.
https://quanwenzhao.files.wordpress.com/2020/02/private_test_post_sql_1.png
https://quanwenzhao.files.wordpress.com/2020/02/private_test_post_sql_2.png
Best Regards
Quanwen Zhao -
I’m glad to hear that works!
I’d recommend removing the original post and posting it again as a new one.
-
Regardless of this odd problem, I’m very boring to recreate my this post. I decide to enable new block editor when writing ✍️ new blog note.
But the initial format of my code is aligned in the editing mode unfortunately my code isn’t aligned when I published it. So every time I need to return back to “edited” status and re-adjust/re-align the code.
BTW I must replace “>” with “>” and “<“ —> “<” on a couple of code tags. When can fix this bug 🐛?
Best Regards
Quanwen Zhao -
Oh, that shouldn’t be happening.
Which block did you use?BTW I must replace “>” with “>” and “<“ —> “<” on a couple of code tags.
I’m not sure I understand what happens, can you give us some more details?
-
I readjust my post and there has this very weird a series of characters such as the following my screenshot (whom I can more cleary see in HTML mode).
https://quanwenzhao.files.wordpress.com/2020/02/private_test_post_weird_html_tag.png
Why fstat can directy paste his screenshot to reply area? (I only save my screenshot to the background of my WordPress and then provide the corresponding webURL).
Now I eliminate all of my code sections and firstly finish editing code (like this, https://quanwenzhao.files.wordpress.com/2020/02/ue_sql_code.png), secondly copy those code in my UE (UltraEdit) editor next paste as “plain text” to my each the original code place on my post. As you can see it’ll be automatically in the mode of “preformatted”, furthermore, the characters “>” and “<“ on my UE editor have been replaced with “&”+”gt”+”;” and “&”+”lt”+”;” (here I deliberately split “&”, “gt” and “;”) on my post page.
Now the display effect of all of my code(s) is ok, I infer that it’s probably related to directly paste those code (without plain text) to my post because “>” hasn’t been converted to “&”+”gt”+”;”.
BTW when I went to my editor page of my post again, I found “&”+”gt”+”;” have been replaced with “>”. Why?
Best Regards
Quanwen Zhao -
I readjust my post and there has this very weird a series of characters such as the following my screenshot (whom I can more cleary see in HTML mode).
Those extra characters that are being added is known bug with the editor, and get added each time you switch the editor between visual and HTML mode. The code-shortcode you’re using is designed to use in the visual editor, not the HTML mode, so as long as you just work in visual mode and don’t switch editor views, that shouldn’t get added.
furthermore, the characters “>” and “<“ on my UE editor have been replaced with “&”+”gt”+”;” and “&”+”lt”+”;” (here I deliberately split “&”, “gt” and “;”) on my post page.
>is the HTML entity representing the > symbol, and<represents the < symbol. It’s normal that the editor converts these. When a post is loaded in the browser it will see those symbols and display < or > instead.You can learn more about HTML entities here:
-
>
and
<
both represents comparison symbols of maths on those SQL code. I should not regard them as HTML entities.
Maybe you misread my real meaning – I don’t talk about “>” and “<“ are showing when my post is loaded, my mean is that which show in the editor page of my post.
Best Regards
Quanwen Zhao
- The topic ‘Why not wrapping SQL code in my this post?’ is closed to new replies.