• Using HTML Import 2.5 –

    I’m importing RoboHelp files into WP. The pages have plenty of tags with the structure <a id="foo" name="foo"></a> to set up internal bookmarks.

    When I import the pages with HTML Import, these empty tags are converted to self-closing, such as

    <a id="foo" name="foo" />

    This leads to the page being rendered like all of the text on it is in an <a> tag, hence it’s blue and the cursor turns to a pointer.

    However, when I switch from the text editor to the visual editor, it fixes the problem, closing all empty tags to the original format. The page renders correctly.

    Is there a way turn off in HTML Import whatever is converting those empty tags into self-closing to begin with? I tried importing with the Clean up bad ( Word, Frontpage ) HTML option both on and off – no difference. Anyway, I definitely need it on for other issues with the pages.

    I also tried commenting out line 227

    $string = preg_replace( "/<[^\/>]*>( [\s]? )*<\/[^>]*>/", ' ', $string );

    to get it to ignore empty tags, but there was no effect. I need to keep those empty tags anyway.

    Thanks for your help and for the incredibly useful plugin!

    https://ww.wp.xz.cn/plugins/import-html-pages/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stephanie Leary

    (@sillybean)

    Oh, RoboHelp. The gift that keeps on giving.

    I’ve seen this problem before in other import situations, and I think it might be happening outside the HTML Import plugin, especially since turning off the HTML cleanup option didn’t help. I’ll experiment and see what I can do.

    Thread Starter eco7eco

    (@eco7eco)

    Haha – thanks, Stephanie!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Prevent empty a tags being converted’ is closed to new replies.