Make WordPress Core

Opened 19 years ago

Closed 18 years ago

#1607 closed defect (bug) (duplicate)

TinyMCE aligning code invalid (XHTML 1.0 Strict/1.1)

Reported by: jonthejester's profile jonthejester Owned by: rob1n's profile rob1n
Milestone: Priority: normal
Severity: normal Version: 2.1.3
Component: TinyMCE Keywords:
Focuses: Cc:

Description

When a person tries to align a block of text in the TinyMCE rich content textarea, TinyMCE gives the text an html attribute of 'align="..."'--for example:

<p align="center">Block of text.</p>

While this is valid in XHTML 1.0 Transitional, this isn't for 1.0 Strict or 1.1. Ideally it should be an inline style, like, say:

<p style="text-align: center;">Block of text.</p>

I tried setting the inline_styles parameter to "true" in wp-admin/tinymce/tiny_mce_src.js, but unfortunately that hasn't changed the current behavior. Any help here?

Attachments (1)

tiny_mce_src.js (152.6 KB) - added by jonthejester 19 years ago.
wp-admin/tinymce/tiny_mce_src.js -- added inline_styles changes

Download all attachments as: .zip

Change History (6)

#1 @jonthejester
19 years ago

Well, in answer to my own problem, I forgot to add "style" to, and remove "align" from, p[...] and div[...] under "valid_elements" in TinyMCE.prototype.init . I have the file attached now with those fixes, as well as setting inline_styles to "true".

There might be other invalid attributes to snip, I don't know, but that's beyond the scope of this ticket. Just please get these fixes in soon. :)

@jonthejester
19 years ago

wp-admin/tinymce/tiny_mce_src.js -- added inline_styles changes

#2 @rob1n
18 years ago

  • Component changed from Administration to TinyMCE

#3 @rob1n
18 years ago

  • Milestone set to 2.2
  • Owner changed from anonymous to andy
  • Version changed from 1.6 to 2.1

#4 @rob1n
18 years ago

  • Keywords align valid tinymce removed
  • Owner changed from andy to rob1n
  • Status changed from new to assigned
  • Version changed from 2.1 to 2.1.3

Reproduced, working on patch.

#5 @rob1n
18 years ago

  • Milestone 2.2 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Closing as dupe of #2131.

Note: See TracTickets for help on using tickets.