Opened 17 years ago
Closed 13 years ago
#2069 closed Bug (wontfix)
Table issue with template and heading
Reported by: | 360R8 | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Project : MediaWiki+FCKeditor | Version: | FCKeditor 2.5.1 |
Keywords: | Cc: |
Description
If I have a table like this {| {{table}}
B |
! 1 | 2 |} After using the editor it gets munged like this {|
| A | B
| 1 | 2 |} Table template removed, and headings changed from ! to |. Any workarounds for this ?
Attachments (1)
Change History (12)
comment:1 Changed 17 years ago by
Keywords: | WorksForMe Pending added; table template headings removed |
---|
comment:2 Changed 17 years ago by
Hello,
thank you for the quick fix on table headers.
For embeding template in table syntax, please take a look at this wiki source http://www.mediawiki.org/wiki/Template:Tableheader
I also tried the following on the sandbox(http://www.mediawiki.org/wiki/Sandbox), and the template is applied properly
{| {{Tableheader}} ! A ! B
|1 |2 |}
Thanks.
comment:3 Changed 17 years ago by
Keywords: | Confirmed added; WorksForMe Pending removed |
---|
Changed 17 years ago by
Attachment: | 2069.patch added |
---|
comment:4 Changed 17 years ago by
Keywords: | HasPatch added |
---|
I'm attaching a patch. It relies on a hook that doesn't exist yet. With this patch, if template is inside of a tag, it is not surrounded by a <span>
tag. It is also required to tell Sanitizer to not remove our special word that is replaced with the template content at the end of processing, that's why new hook is necessary.
In includes/Sanitizer.php
, function fixTagAttributes
, add this before the last line (with return statement):
if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text, $element, &$attribs ) ) ) { return ''; }
it should look similar to:
static function fixTagAttributes( $text, $element ) { if( trim( $text ) == '' ) { return ''; } $stripped = Sanitizer::validateTagAttributes( Sanitizer::decodeTagAttributes( $text ), $element ); $attribs = array(); foreach( $stripped as $attribute => $value ) { $encAttribute = htmlspecialchars( $attribute ); $encValue = Sanitizer::safeEncodeAttribute( $value ); $attribs[] = "$encAttribute=\"$encValue\""; } if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text, $element, &$attribs ) ) ) { return ''; } return count( $attribs ) ? ' ' . implode( ' ', $attribs ) : ''; }
Let me know if that worked for you.
comment:7 Changed 17 years ago by
Hook added to the core in MediaWiki 1.13 (r33726, r33725): https://bugzilla.wikimedia.org/show_bug.cgi?id=13821.
Users of MW 1.10-1.12 must apply changes in includes/Sanitizer.php manually.
comment:8 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The patch was reverted. Awaiting a further suggested patch at https://bugzilla.wikimedia.org/show_bug.cgi?id=13821
comment:9 Changed 16 years ago by
This fix doesn't seem to work for me. After adding the hook into MediaWiki, I added a template to a table header and switched back and forth between wikitext view and fck view. The template seems to be remain (which is good). But it gets converted to all lowercase text. So {| {{TableStyle}} becomes {| {{tablestyle}} (which is bad).
Also, if I save a page with a table style header when FCK is disabled and then reenable FCK and edit that page, the style header is gone. So I can't edit a page, save it, and then edit it again basically.
comment:10 Changed 16 years ago by
Keywords: | Patch reverted added; HasPatch removed |
---|
*Push* The problem is already present in V2.6.4 and MediaWiki 1.13. Can anybody find a working solution please?!
comment:11 Changed 13 years ago by
Keywords: | Confirmed Patch reverted removed |
---|---|
Resolution: | → wontfix |
Status: | reopened → closed |
MediaWiki and FCKeditor are no longer supported. Closing the ticket
Check the latest version of MediaWiki extension. Problem with table headers has been fixed today (#2044).
I believe that
{{table}}
can't appear after {|. I tried to add the following textin MediaWiki Sandbox and the table template has been stripped as well, so the behaviour seems to be correct.