Monday 26 January 2009 2:38:55 am
Update, found some other webpages that mention this issue, and here is part of the stuff that could come from word:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="ProgId" content="Word.Document" /><meta name="Generator" content="Microsoft Word 12" /><meta name="Originator" content="Microsoft Word 12" /><link rel="File-List" href="file:///C:\Users\User\AppData\Local\Temp\msohtmlclip1\01\clip_filelist.xml" [^] /><link rel="themeData" href="file:///C:\Users\User\AppData\Local\Temp\msohtmlclip1\01\clip_themedata.thmx" [^] /><link rel="colorSchemeMapping" href="file:///C:\Users\User\AppData\Local\Temp\msohtmlclip1\01\clip_colorschememapping.xml" [^] />
Meta tag is no problem, as the parser ignores it, links on the other hand are not ignored. So here is a patch for ezoe to ignore the word 2007 links, and if you have word 2007 please test it if you can:
Index: trunk/ezoe/ezxmltext/handlers/input/ezoeinputparser.php
===================================================================
--- trunk/ezoe/ezxmltext/handlers/input/ezoeinputparser.php (revision 3495)
+++ trunk/ezoe/ezxmltext/handlers/input/ezoeinputparser.php (working copy)
@@ -76,7 +76,7 @@
'ul' => array( 'name' => 'ul' ),
'li' => array( 'name' => 'li' ),
'a' => array( 'nameHandler' => 'tagNameLink' ),
- 'link' => array( 'name' => 'link' ),
+ 'link' => array( 'nameHandler' => 'tagNameLink' ),
// Stubs for not supported tags.
'tbody' => array( 'name' => '' ),
'thead' => array( 'name' => '' ),
@@ -254,8 +254,17 @@
function tagNameLink( $tagName, &$attributes )
{
$name = '';
- if ( isset( $attributes['href'] ) )
+ if ( isset( $attributes['href'] )
+ && isset( $attributes['rel'] )
+ && ( $attributes['rel'] === 'File-List' || $attributes['rel'] === 'themeData' || $attributes['rel'] === 'colorSchemeMapping' )
+ && ( strpos( $attributes['href'], '.xml' ) !== false || strpos( $attributes['href'], '.thmx' ) !== false) )
{
+ // empty check to not store buggy links created
+ // by pasting content from ms word 2007
+ }
+ else if ( isset( $attributes['href'] ) )
+ {
+ // normal link tag
$name = 'link';
if ( isset( $attributes['name'] ) && !isset( $attributes['anchor_name'] ) ) $attributes['anchor_name'] = $attributes['name'];
}
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom
|