posting “` javascript markdown DOES NOT show ”

  • Author
    Posts
  • #3186064

    jd111
    Member

    How can i make this work?
    Please see displayed post : https://joecodeswell.wordpress.com/2018/09/25/react-state-example-1-update-state-using-2-select-elements/
    Please see also post markdown html.
    Notice line 85 is blank in the displayed post
    BUT NOT in the markdown html
    Please help me. I want to use wordpress.com to show my work but not with this unreliability!

    The blog I need help with is joedorocak.wordpress.com.

    #3186386

    Hi jd111,

    The blank space on line 85 is caused by an empty line in the HTML tab on the editor — which isn’t visible on the Visual tab. I copied the post into a test site, removed the empty line from the HTML tab and the blank space disappeared.

    Were you working on the visual tab in the new interface or the classic WP Admin interface?

    #3186547

    jd111
    Member

    Hi gemmacevans, thanks for the reply.

    I was NOT on the visual tab, i was on the HTML tab, writing my post using markdown.

    When i checked the HTML tab editor after reading your reply, that line WAS INDEED blank in the HTML tab.

    HOWEVER , just now, i repeated the editing & publishing steps I took before i wrote this support request.

    RESULT: Line 85 in the published post is blank, BUT in the STILL OPEN HTML TAB EDITOR, It is NOT blank.

    The line lives inside a markdown javascript bla bla bla code in here bla bla bla demarcation.

    Th line is:
    <select id=”select-to” value={this.key} onChange={this.handleToChange} >

    Here is a link to the code i just copied into the jvascript bla bla bla demarcation.

    https://drive.google.com/open?id=1Tk_S5Z3V7F7NVKtkm88F2GCD-QLgbAKp

    Thanks for your help. I know this is a tough one.

    This is VERY IMPORTANT to me as a publisher of javascript example code.

    Thanks again.
    Love and peace,
    Joe Dorocak aka JoeCodeswell.com

    #3186548

    jd111
    Member

    My suggestion is for you folks to add one more tab to the editor named “Markdown” & promise to keep it’s contents untouched after they are entered, generating all HTML from the Markdown Tab.

    Thanks again.

    Love and peace,
    Joe

    #3186667

    supernovia
    Staff

    Hi Joe, sorry about that. Can you confirm whether it makes any difference if you use our other editor? That would help us determine where the bug might be.

    So if you’re using the HTML tab on WordPress.com/post, try the tab at https://joecodeswell.wordpress.com/wp-admin/post.php instead, or vice versa.

    #3187792

    jd111
    Member

    Hi supernovia. Thanks for the reply.

    I was using the HTML tab on the editor at https://wordpress.com/post/joecodeswell.wordpress.com/1988
    I am pretty sure about that because i usually click on the pencil that comes up when i go to the post.

    i just now
    1. went to https://joecodeswell.wordpress.com/wp-admin/post.php?post=1988&action=edit
    2. copied all the text from
    https://drive.google.com/open?id=1Tk_S5Z3V7F7NVKtkm88F2GCD-QLgbAKp

    into the space in the editor between the backticcks.

    backtick backtick backtick javascript
    i pasted in here
    backtick backtick backtick

    3. Before i push update button the lines near “Pick your FROM” in the editor read
    Pick your FROM Programmer:
    <select id=”select-from” value={this.value} onChange={this.handleFromChange} >
    {this.state.programmer_list.map( (itm,ix) => <option key={ix} value={ix+”:”+itm} >{itm}</option> ) }

    4. After i push update button the lines near “Pick your FROM” in the editor read
    Pick your FROM Programmer:

    {this.state.programmer_list.map( (itm,ix) => {itm} ) }

    Either way the code disappears from the post
    Thanks again, supernovia.
    Love and peace,
    Joe

    #3187804

    melancholia
    Member

    I just tried that on one of my sites — it doesn’t seem to matter if you use the visual editor or the text/html editor, WordPress is not treating everything in between the CODE tags as untouchable. (Note: I tried it on a WordPress.org installation as well and it does different things to the code but is pretty much as bad at leaving it alone as WordPress.com.)

    You can see a comparison between the original code added to the post to what is there after you save the post at https://www.diffchecker.com/Yh4W5uyy — you can see that it cleans up what it perceives to be HTML tags, even though it shouldn’t be looking at them at all within the CODE tags, and strips out some of the code.

    #3187815

    melancholia
    Member

    @jd111 I just checked out the WordPress.com support page for posting code snippets and it looks like you should be able to do what you want to do by wrapping the code in the [code] shortcode tags rather than using the "code" HTML tags in the editor toolbar. You can see my test here.

    #3188112

    jd111
    Member

    Hi melancholia. Thanks for the effort. You certainly understood the problem.
    However, just now,editing the post with “https://wordpress.com/post/joecodeswell.wordpress.com/1988”, in the HTML tab, I

    replaced

    
    backtick backtick backtick javascript
    my code in here
    backtick backtick backtick
    

    with

    
    [code language=""javascript""]
    my code in here
    [/code]
    

    THE RESULT IS HORRIBLE!
    See post present state at https://joecodeswell.wordpress.com/2018/09/25/react-state-example-1-update-state-using-2-select-elements/

    The indentation dissappears for the first half.
    I don’t know what all the other stuff is.

    Please send this up the chain.
    Thanks again for the effort.
    Love and peace,
    Joe

    #3188117

    jd111
    Member

    Also THIS editor misrepresented what i pu into the above.

    I put in:

    LEFT_BRACE code language EQUALS DBL_QUOTE javascript DBL_QUOTE RIGHT_BRACE

    Also the above reply INCORRECTLY says –

    LEFT_BRACE code language EQUALS DBL_QUOTE DBL_QUOTE javascript DBL_QUOTE DBL_QUOTE RIGHT_BRACE

    PLEASE PLEASE PLEASE move this up the chain to a Staff Programmer from Automatic.

    Thanks again melancholia.
    Love and peace,
    Joe

    #3188146

    jd111
    Member
    
    Dear WordPress.com / Automatic.com / ma.tt:
    
    Subject: PROBLEMATIC programming language code publishing.
    
    I WANT to stay with WordPress.com.
    
    However the PROBLEMATIC programming language code publishing is a very big challenge for me.
    
    Please see the following & similar forum posts from me:
    
    https://en.forums.wordpress.com/topic/posting-javascript-markdown-does-not-show/#post-3188117
    
    I am considering moving to Medium.
    
    PLEASE PLEASE PLEASE consider adding a "Markdown Tab" to your editors. 
    
    AND make sure programming code, written in that Tab, is faithfully rendered in the final post.
    
    Thanks.
    
    Love and peace,
    
    Joe Dorocak
    Please Twitter Direct Message Me
    @JoeCodeswell
    
    #3188212

    melancholia
    Member

    That’s so odd.

    I just tried using the [code] tags using both the wp-admin editor and the new one and I get the same, correct results each time with the code showing up exactly as pasted in. See <a href="https://klutzorama.wordpress.com/2018/09/28/testing-javascript-code-snippet-wp-admin/">using wp-admin here</a> and <a href="https://klutzorama.wordpress.com/2018/09/29/testing-javascript-code-snippet-new-editor/">new editor here</a>.

    I can't see the post on your site, but your reply here says you just replaced the tags at the beginning and end of the existing content -- wasn't that content already messed up from the previous attempts at using the code HTML tags? Try it again in a fresh post with <code>[code language=&quot;javascript&quot;]</code>
    at the beginning and your code copied and pasted in fresh from somewhere other than a WordPress post (e.g. your Google drive file), and <code>[/code] at the end. See if you then see what I see.

    #3188213

    melancholia
    Member

    (Well, the forum here messed up the code shortcode tags, but you know what I mean.)

    #3188222

    melancholia
    Member

    (Or rather I messed up all of my tags — sure wish we could edit replies. LOL Hopefully it’s still understandable.)

    #3188225

    melancholia
    Member

    OK, let me start all over again. (Ignore my earlier reply, er, replies today.)

    Looking at my two test pages more closely, it looks like the new editor does still make some changes but creating/editing the post in the /wp-admin editor leaves it intact.

    Compare https://klutzorama.wordpress.com/2018/09/29/testing-javascript-code-snippet-new-editor/ to https://klutzorama.wordpress.com/2018/09/28/testing-javascript-code-snippet-wp-admin/.

    So, @jd111, try creating a new post in https://joecodeswell.wordpress.com/wp-admin/ using the [code] tags and a fresh copy of your code and see if that works for you the way it does for me. In my test posts, you can see that, while the new editor changes some of the characters, the /wp-admin editor leaves everything intact. (I compared my output to your original code and the /wp-admin editor did not change any of the code.)

    #3189595

    jd111
    Member

    Dear @melancholia,

    Thanks for all the GREAT work.

    “/wp-admin editor”. I had NO IDEA about the difference.

    I STILL want Automatic to make a “Markdown Tab”, however you have SIGNIFICANTLY improved my relationship with WordPress.com.

    Thanks again.

    Love and peace,
    Joe

    #3190986

    melancholia – Thanks for helping us out :)

    Joe – I’m happy to hear you are sorted now. Best wishes :)

You must be logged in to reply to this topic.