Hello,

Maybe i'm missing something....

Can I turn HTML off in Diff, so that it works with a WYSIWYG editor?

Rotzi had a patch for this but I was wondering if it has been incorporated into this version, it would really help.

Thanks!

Comments

moshe weitzman’s picture

Status: Active » Closed (works as designed)

thats now how we have designed this. it diffs raw input.

tobylechien’s picture

Hi,

More and more users use WYSIWYG editors and don't even know what HTML is. Does the way you designed the plug-in make it possible to offer 2 modes :
- Diff showing HTML tags (current mode)
- Diff rendering HTML tags. In this mode, the diff part would include HTML tags in real HTML (instead of using HTML entities for < and >) so that the user can actually see the formatted change.

???

Stripping HTML tags is one option but in this case, the diff never displays the formatting changes (and it generates all sorts of problems). If the HTML is rendered, then users can see all changes, including the formatting ones, and it is more intuitive.

Would this be easier to implement than tag stripping ?

Toby.

manasiv’s picture

Hi Moshe..
I work on a Web 2.0 Drupal based site. We really like the diff module and have started using it instead of the custom code we had for Drupal 4.7

It would be good to have the HTML tags stripped during comparison. We have used strip_tags as of now.

mehul_gada’s picture

Hi,

Using the strip_tags is a good idea, but it fails when you have the body of the node with more then 10 thousand characters.
You can see the entire difference in red colour. So I suggest following method.

While passing the node body to diff engine, strip all tags except <p> tags.
then replace '<p>' tages by new line char '\n' and '</p>' tag by space.
the code will look like this:

$body = strip_tags($body);
$body=str_replace('<p>,"\n",$body);
$body=str_replace('</p>',' ',$body);

The reason to replace

tags by new line char is to facilitate the breaking of page in proper paragraph.

philbar’s picture

subscribe