• Resolved gwalk

    (@gwalk)


    Hello,
    I have a problem with TinyMCE. May be it’s some kind of plugin conflict or something like this.

    The problem is: I’m entering editing of the some page and see block empty called Classic Paragraph. Strange… Next I’m entering the same page but from user perspective and see that this page contains data. So for some reason TinyMCE won’t show me the data.

    I’m using:
    WordPress 5.2
    Block Editor (Gutenberg)

    Template: Hestia v 2.4.4 by ThemeIsle
    Plugins:
    Envira Gallery Lite
    Google Analytics for WordPress by MonsterInsights
    Instagram Feed
    Orbit Fox Companion
    WPForms Lite
    Yoast SEO
    TinyMCE Advanced

    There is the error in JS console. It there is only this error it will work:

    Format "tadv/mark" is already registered to handle bare tag name "mark". rich-text.min.js:1:12382
        re /wp-includes/js/dist/rich-text.min.js?ver=3.2.2:1
        <anonymous> /wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/build/block.js?ver=1.2.1:1

    BUT, if there are those errors it will not work:

    
    Format "tadv/mark" is already registered to handle bare tag name "mark". rich-text.min.js:1:12382
    Block validation: Expected token of type <code>StartTag</code> ( 
    Object { type: "StartTag", tagName: "p", attributes: [], selfClosing: false }
     ), instead saw <code>EndTag</code> ( 
    Object { type: "EndTag", tagName: "p" }
     ). blocks.min.js:2:100142
    Block validation: Block validation failed for <code>core/html</code> ( 
    Object { name: "core/html", title: "W?asny HTML", description: "...", icon: {…}, category: "formatting", keywords: (1) […], supports: {…}, attributes: {…}, transforms: {…}, edit: WithSelect(t)()
    , … }
     ).
    
    Content generated by <code>save</code> function:
    
    <p></p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;"></p>
    
    Content retrieved from post body:
    
    </p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;"> blocks.min.js:2:100142
    Block validation: Expected token of type <code>StartTag</code> ( 
    Object { type: "StartTag", tagName: "p", attributes: [], selfClosing: false }
     ), instead saw <code>EndTag</code> ( 
    Object { type: "EndTag", tagName: "p" }
     ). blocks.min.js:2:100142
    Block validation: Block validation failed for <code>core/html</code> ( 
    Object { name: "core/html", title: "W?asny HTML", description: "...", icon: {…}, category: "formatting", keywords: (1) […], supports: {…}, attributes: {…}, transforms: {…}, edit: WithSelect(t)()
    , … }
     ).
    
    Content generated by <code>save</code> function:
    
    <p></p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;"></p>
    
    Content retrieved from post body:
    
    </p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;"> blocks.min.js:2:100142
    Block validation: Expected token of type <code>StartTag</code> ( 
    Object { type: "StartTag", tagName: "p", attributes: [], selfClosing: false }
     ), instead saw <code>EndTag</code> ( 
    Object { type: "EndTag", tagName: "p" }
     ). blocks.min.js:2:100142
    Block validation: Block validation failed for <code>core/html</code> ( 
    Object { name: "core/html", title: "W?asny HTML", description: "Dodaj w?asny kod HTML i podejrzyj go podczas edycji.", icon: {…}, category: "formatting", keywords: (1) […], supports: {…}, attributes: {…}, transforms: {…}, edit: WithSelect(t)()
    , … }
     ).
    
    Content generated by <code>save</code> function:
    
    <p></p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p></p>
    
    Content retrieved from post body:
    
    </p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Andrew Ozz

    (@azaozz)

    Hi @gwalk, thanks for posting the error messages.

    As far as I see there are several errors here:

    Format "tadv/mark" is already registered..., comes from: /wp-content/plugins/themeisle-companion/vendor/....

    That means you have a plugin called “themeisle-companion” that is also trying to add support for <mark> tag. I’d suggest to either disable this functionality in TinyMCE Advanced (by moving the Mark button to the Inactive buttons), or disable that in the themeisle-companion plugin (if it is possible). As you mention this error shouldn’t prevent the editor from working.

    The more serious error 1s with content validation:

    Block validation failed for “core/html”
    Content generated by “save” function (i.e. that’s how it should be):

    <p></p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;"></p>

    Content retrieved from post body (that’s how it is in the post):

    </p>
    <p data-tadv-p="keep" style="text-align: justify;">My content is here...</p>
    <p data-tadv-p="keep" style="text-align: justify;">

    There seem to be couple of errors here:
    1. Somehow an empty <p> tag is added at the beginning. That tag is probably not in the post content. One way that may happen is if the opening block tag <!-- wp:tadv/classic-paragraph --> is removed from the content (or the block is not registered?) but the line break after it is still there, so then wpautop adds a whole paragraph because of that line break.

    2. “Something” is removing the first opening <p> tag and the last closing </p> tag. This is what causes all the validation errors. Not sure what’s going on but this shouldn’t happen, ever. Tried to reproduce it with and without TinyMCE Advanced activated but am not able to. My guess is this is being done from another plugin that “manipulates” the blocks outside the editor, perhaps.

    Few things to try:
    – Go to the TinyMCE Advanced settings screen, Settings->TinyMCE Advanced and see if the Classic Paragraph block is enabled in advanced options. The errors you posted don’t mention it which is very strange.
    – Export the TinyMCE Advanced settings if you want (just for convenience), then reset it to default settings. Then move the Mark button to inactive (to prevent the first error) and save settings. Now try to see if the editor works properly and the Classic Paragraph blocks show.
    – If still problems, try changing the settings or disabling other plugins that change the block editor. Seems “themeisle-companion” is one.
    – If still no good, perhaps look in the “Code Editor” inside the block editor (switch to it from the dot dot dot menu at the very top/right). Try to delete all <!-- wp:tadv/classic-paragraph --> and <!-- /wp:tadv/classic-paragraph --> lines including the line breaks before and after them. Then switch back to “Visual editor” from the same menu. This should “convert” all Classic Paragraph blocks into Classic blocks.

    And of course let me know how it goes ??

    Plugin Author Andrew Ozz

    (@azaozz)

    @gwalk any updates? Or were you able to figure out what’s causing these errors?

    Thread Starter gwalk

    (@gwalk)

    Hello, @azaozz sure. Sorry for delay ?? Here is short description.
    1. I have disabled <mark> tag and it solved first problem.
    2. I have debugged 2 problem a little bit. Guess that the problem was about copying text from wordpress default block editor to tinyMCE. This action produces unnecessary empty <p>. When I’ve copied text from web page to text editor (sublime) and then from sublime to tinyMCE the problem gone. But I’m not sure, cause sometimes everything works correctly. Will check and let you know.
    Thanks!

    Plugin Author Andrew Ozz

    (@azaozz)

    No response in about two months. Assuming this was fixed or a workaround was found ??

    FIX worked perfectly for me. Thank you so much

    fxwegr

    (@fxwegr)

    In the Gutenberg Editor, the toolbox of TinyMCE is no longer displayed in the Classic Block. I am using TinyMCE Advanced. How can I solve the problem?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Empty Classic Paragraph block while page contains text’ is closed to new replies.