Resolved Problem: Removing spaces from between words

0 views
Skip to first unread message

Andrew Rickmann

unread,
Mar 23, 2008, 12:19:16 PM3/23/08
to hkit-discuss
I'm using hkit as part of a WordPress plugin to parse pingbacks for
hReviews and I came across a problem which I found two ways to solve,
so I thought I would post it here for your reference.

The problem is that tidy wraps the content of the page which means
that at times a space is converted into a line break.

Hkit then removes the line breaks, at the end of the get_node_value
function leaving two words without spaces between them.

The two methods of solving this that I have used are:

1. Using the PHP5 Tidy object with config parameters, set the wrap to
a really large number.
2. Amend the replace function, around line 293 of V0.5, to replace
line breaks, new lines, and tabs with a space.

I have amended the version I am using to do both these things as it
suits the use.

Drew McLellan

unread,
Mar 24, 2008, 11:24:04 AM3/24/08
to hkit-discuss
That sounds great, Andrew.

Are the any known disadvantages to approach #2? If it's something you
think would be generally useful in the codebase, perhaps you could
submit a patch?

Thanks!

Drew.

Andrew Rickmann

unread,
Mar 24, 2008, 2:45:03 PM3/24/08
to hkit-discuss
I'm not sure at the moment. I am going to put it out there and see
what happens.

I will submit a patch when I have had a chance to consider the
implications a bit more.

Andrew
Reply all
Reply to author
Forward
0 new messages