Opened 17 years ago
Last modified 7 years ago
#10269 assigned defect (bug)
wysiwyg bug with shortcodes
| Reported by: | Denis-de-Bernardy | Owned by: | miqrogroove |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Formatting | Version: | 2.8 |
| Severity: | normal | Keywords: | wpautop |
| Cc: | Focuses: |
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
@
17 years ago
- Component Formatting → TinyMCE
- Keywords wpautop added
- Owner set to
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
@
17 years ago
- Component TinyMCE → Formatting
- Owner removed
- Priority normal → low
- Severity normal → 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
@
17 years ago
- Milestone 2.9
- Resolution → wontfix
- Status new → closed
k... sounds like a wont ever fix to me... :-)
#5
@
17 years ago
- Milestone → Future Release
- Resolution wontfix
- Status closed → reopened
- Version → 2.8
Doesnt sound like a wontfix to me.
#6
follow-up:
↓ 9
@
17 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
@
17 years ago
- Milestone Future Release → 2.9
cool. well, the fix, if any, is to wrap standalone shortcodes into <div> tags.
#9
in reply to: ↑ 6
@
17 years ago
- Resolution → wontfix
- Status reopened → 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
@
16 years ago
- Milestone 2.9 → 3.0
- Resolution wontfix
- Status closed → 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
@
14 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
@
12 years ago
- Keywords has-patch wpautop close removed
- Resolution → wontfix
- Severity minor → normal
- Status reopened → closed
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
it's related to this line in wpautop:
$pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone