Make WordPress Core

Opened 3 years ago

Last modified 20 months ago

#15251 new defect (bug)

Adding Image breaks Blockquote

Reported by: kitoconnell Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0.1
Component: TinyMCE Keywords: dev-feedback
Focuses: Cc:


When creating entries, adding an image regularly breaks my code.

I am working on a wordpress-based project where I am defining a 'lexicon' of words. I have discovered this bug during the following standard behavior I follow in creating an entry:

All my entries open with a number of words in bold text followed by a definition. These are encapsulated in a blockquote (see example1.jpg or real world examples at kitoconnell.com/lexicon). At first, the visual editor works fine, creating healthy code as I request (I am creating these in the visual editor, but see code example code1.jpg).

Then, I add a photo and the code breaks and has to be fixed manually in the HTML editor. See attached files example2.jpg and code2.jpg; I have not made any changes except to embed a photo with a caption. Adding a picture has moved the blockquote and bold tags to incorrect positions.

Although this is not a system breaking bug, it is an annoyance I am encountering on a daily basis. Thanks for your attention and let me know if anything is unclear or I can provide more data.

Attachments (4)

example1.jpg (79.7 KB) - added by kitoconnell 3 years ago.
first example
code1.jpg (112.7 KB) - added by kitoconnell 3 years ago.
code for example1
example2.jpg (81.4 KB) - added by kitoconnell 3 years ago.
after adding the image
code2.jpg (102.5 KB) - added by kitoconnell 3 years ago.
code breaks after adding image

Download all attachments as: .zip

Change History (7)

kitoconnell3 years ago

first example

kitoconnell3 years ago

code for example1

kitoconnell3 years ago

after adding the image

kitoconnell3 years ago

code breaks after adding image

comment:1 dd323 years ago

  • Keywords needs-patch needs-testing added
  • Milestone changed from Awaiting Review to Future Release

comment:2 solarissmoke2 years ago

  • Keywords reporter-feedback close added; needs-patch needs-testing removed

I cannot reproduce this in 3.3 - inserting an image in the way you describe doesn't mess with the surrounding code. Is it still an issue for you?

comment:3 ocean9020 months ago

  • Component changed from Editor to TinyMCE
  • Keywords dev-feedback added; reporter-feedback close removed

The issue is that the media dialog inserts the image to the current cursor position. By default this is before the first character. If the first word is wrapped in a tag the image will be wrapped too.

I think you should change your workflow and insert first the image and then the text.

Not sure if we can fix here something.

Note: See TracTickets for help on using tickets.