• Hi,

    I finally decided to do it, to move from MT version-ancient to WP (and there was much rejoicing).

    The install went really smoothly, but it appears that my

    <img src=”foo” alt=”bar”> tags have been truncated to <img> tags.

    Compare:

    https://www.stevengharms.com/archives/000689.html

    and my pilot-install:

    https://stevengharms.com/wp/?p=622

    I took a look at the PHP file ( figured it can’t be too different from my mother tongue of perl ) and couldn’t see any glaring regex munging that might be going wrong in the mt import php script.

    I did notice that in all of my source files <img> tags were appropriately XHTML-ish-ly closed with the /> syntax.

    any pointers

Viewing 3 replies - 1 through 3 (of 3 total)
  • This would be my “newb” fix. I’m not sure what caused this problem, but to fix it what I would do is copy the sql database into a simple text file, do a find for the <img> tag, and each time you come acress one <i>re-code the alt tag into each picture by hand</i>. Then re-import this news sql file.

    I hope you don’t have, like, 10,000 image links or something.

    Alternately, you could just let the alt tags go.

    Perhaps someone a bit more sophisticated can come up with a better solution. Sorry!

    Thread Starter sgharms

    (@sgharms)

    Brittanie,

    Thanks for the tip. Before i started hacking up some Perl I thought that I’d check to see if this is something standard. Maybe I can figure out something to make this go by a little bit faster.

    Thanks,

    Steven

    Thread Starter sgharms

    (@sgharms)

    Brittanie, et al,

    So basically on the import, it appears that WP *insists* that the <img> tag be written to the specification of the W3C. This is not a horrible thing unless you’ve been, like me, insconsistent in the application of the alt= tag.

    I wrote a real quick perl script to take an MT file, and then put in a generic alt= tag. While filling it in with something meaningful ( by hand ) is probably more approrpiate, I’ve not the energy to tackle all of those on day 1 of the import.

    As such, i wrote this script to do the alt tag addition for me:


    #!/usr/bin/perl -w
    #===============================================================================
    #
    # FILE: fix_img_tag.pl
    #
    # USAGE: cat (somefile) | ./fix_img_tag.pl
    #
    # DESCRIPTION: This is a tool to take the exported movable type blog file
    # and fix the image tag so that WordPress can import.
    #
    # OPTIONS: ---
    # REQUIREMENTS: ---
    # BUGS: ---
    # NOTES: ---
    # AUTHOR: Steven G. Harms (SGH), <[email protected]>
    # COMPANY: No company at all
    # VERSION: 1.0
    # CREATED: 04/16/06 13:50:16 PDT
    # REVISION: ---
    #===============================================================================

    use strict;

    my @entry_arrray = <STDIN>;

    for ( @entry_arrray ){
    # If it contains img and doesns't have an alt tag, put a generic one in
    if ( /<img/ && !/alt/ ){
    s#<img #< img alt="Alt Tag Added during WordPress Conversion" #;
    print $_
    }else{
    print $_
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Easter Resurrection: MT to WP: img tags not coming along?’ is closed to new replies.