Plugin Author
benz1
(@benz1)
Sorry wp.man but I am unable to replicate this.
The following html in a post
<p>[contentblock id=50 img=form.png] hello world</p>
where contentblock id=50 is “* This is a test *”
creates the following output for me:
* This is a test * hello world
Thread Starter
wp.Man
(@wpman-1)
i think i might have misled you benz1 – the output on the rendered page is fine, it’s in the source code where the opening ‘p’ tag gets dumped, so the source looks like…
content block hello world</p>
i’ll do some testing and see if i can’t provide more detail…
Thread Starter
wp.Man
(@wpman-1)
this appears to be wordpress/tiinymce issue – god i hate that editor!
TinyMCE Advanced plugin helps a bit, but it’s still not retaining the opening <p>
sorry for the bother
Plugin Author
benz1
(@benz1)
No problem. Can you add the opening <p> into the content block?
Thread Starter
wp.Man
(@wpman-1)
not really an option since it will mess up the code in other places where the block is used.
what i’m seeing though is this; if i insert a plain text (general) block on a line by itself, then view the source (with TinyMCE Advanced installed), the opening/closing ‘p’ tags are present. however when previewing/updating the page and then checking the source in the browser, they are both gone.
and then, as previously mentioned, if i insert a block on the same line as existing text, the opening ‘p’ is AWOL when previewing. sometimes the source ends up in the browser source as…
block hello world<p></p>
sometimes just the closing tag is there.
so i’m not really sure what is responsible for stripping the tags.
what do you think?
if i add anything before and after the block – even just a dot – then the tags are not stripped. so, apparently, TinyMCE and/or WP simply doesn’t “see” the blocks and so it strips the tags – this explains why only the opening tag is stripped if the content block is the first object on a line with other text. CKEditor produces the same results (i just tried it).
could you try just putting a plain text block on its own line, as a paragraph, then save/preview the page and look at the source in your browser to see if the tags are there?
Plugin Author
benz1
(@benz1)
The stripping out of tags after you switch to visual mode or save/update is a WP/TinyMCE feature. In fact adding a period the same color as the background is one way to force it to retain a paragraph break.
I’ve never seen and can’t replicate just one tag disappearing. Sorry but I don’t think this is a GCB issue. Maybe a conflict with another plugin?
Thread Starter
wp.Man
(@wpman-1)
hi ben
out of curiosity, what happens on your end if you put a plain text block on it’s own line in <p></p>
, then view the source in your browser?
Plugin Author
benz1
(@benz1)
Not sure at which point you mean but I get as follows:
In editor HTML mode:
<p>[contentblock id=50 img=form.png]</p>
After switching to Visual mode and back to HTML:
[contentblock id=50 img=form.png]
Page source when previewed:
* This is a test *
Page source when previewed straight from HTML mode without switching to Visual mode:
* This is a test *
Page source after being published straight from HTML mode without switching to Visual mode:
* This is a test *
Page source after being published from Visual mode without switching to Visual mode:
* This is a test *
In every case, after switching to Visual mode, previewing or publishing, both opening and closing <p> tags are stripped out.
Thread Starter
wp.Man
(@wpman-1)
ok, thanks
sorry for the bother. knowing the limitations, i’ll adjust accordingly 🙂
again, great plugin!