Opened 15 years ago
Last modified 5 years ago
#10269 assigned defect (bug)
wysiwyg bug with shortcodes
Reported by: | Denis-de-Bernardy | Owned by: | miqrogroove |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | 2.8 |
Component: | Formatting | Keywords: | wpautop |
Focuses: | Cc: |
Description
When inserting two consecutive shortcodes on separate lines, the wysiwyg editor will change the post's contents on save.
[caption /] [caption /]
gets turned into:
[caption /] [caption /]
the odd thing is that only genuine shortcodes get changed, too. the following is left alone:
[notashortcode /] [notashortcode /]
Attachments (1)
Change History (20)
#2
@
15 years ago
- Component changed from Formatting to TinyMCE
- Keywords wpautop added
- Owner set to azaozz
Moving this to TinyMCE, because the issue really belongs in there. When loading a post with shortcodes in TinyMCE, we should actually add the needed paragraphs in such an event, to ensure that things remain properly formatted.
#3
@
15 years ago
- Component changed from TinyMCE to Formatting
- Owner azaozz deleted
- Priority changed from normal to low
- Severity changed from normal to minor
This is clearly a minor wpautop issue (not even sure if it needs fixing), and has nothing to do with TinyMCE.
Filtering the content before loading it in TinyMCE is only done with the php version of wpautop, any other filtering would open a huge can of worms. And what about people that only use the html editor or a different visual editor?
#4
@
15 years ago
- Milestone 2.9 deleted
- Resolution set to wontfix
- Status changed from new to closed
k... sounds like a wont ever fix to me... :-)
#5
@
15 years ago
- Milestone set to Future Release
- Resolution wontfix deleted
- Status changed from closed to reopened
- Version set to 2.8
Doesnt sound like a wontfix to me.
#6
follow-up:
↓ 9
@
15 years ago
While its a minor issue, I dont think its something that should just be closed off as "its only a small bug. dont worry about it"
I'm not sure what the deal should be with this, I mean, Having 2 shortcodes after one another is a completely legit setup, and i'm not sure if they should have to auto-wrap themselves in a <p>
.. Afterall, the user may want to use it inline.
BUT the shortcode may already contain a block element, such as a div.. So it needs some more thought i think. According to Norman- on IRC, It worked line this fine under 2.7..
#7
@
15 years ago
- Milestone changed from Future Release to 2.9
cool. well, the fix, if any, is to wrap standalone shortcodes into <div> tags.
#9
in reply to:
↑ 6
@
15 years ago
- Resolution set to wontfix
- Status changed from reopened to closed
Replying to dd32:
I'm not sure what the deal should be with this, I mean, Having 2 shortcodes after one another is a completely legit setup, and i'm not sure if they should have to auto-wrap themselves in a
<p>
.. Afterall, the user may want to use it inline.
Exactly, shortcodes shouldn't be force-wrapped in block elements. Think there was a long discussion about a year ago whether to process shortcodes before or after wpautop which is related to this.
It doesn't make any difference how they are displayed in the editor as putting a shortcode on a new line wouldn't wrap it in <p> anyways and this is the correct behavior.
#10
@
14 years ago
- Milestone changed from 2.9 to 3.0
- Resolution wontfix deleted
- Status changed from closed to reopened
There is still an issue here I think. Even if I wrap the shortcode in <p> elements, all <p> tags are stripped and the two shortcodes appear side-by-side. This is fine if I know to wrap them in div's, but for the average user trying to lay things out, this is definitely a problem.
#12
@
12 years ago
I agree with azaozz. If the shortcode was wrapped in autop and then the content of the shortcode was "<div>hello</div>" you would end up with "<p><div>hello</div></p>" which is incorrect markup. I think to wrap the shortcode in p tags would create more problems than it would fix.
#15
@
10 years ago
- Keywords has-patch wpautop close removed
- Resolution set to wontfix
- Severity changed from minor to normal
- Status changed from reopened to closed
it's related to this line in wpautop: