Thw wysiwyg editor uses this format for paragraphs and line breaks "

". HtmLawed removes this tags, resulting in no paragraphs nor line breaks.

Any advice?

Thanks.

Comments

federico’s picture

Sorry, I wanted to post this:

My wysiwyg editor uses this format for paragraphs and line breaks </P><P>

HtmLawed removes this tags, resulting in no paragraphs nor line breaks.

Any advice?

Thanks.

alpha2zee’s picture

Do you have other filters besides htmLawed enabled? Including Drupal's line-break converter, etc.? If so, I'd suggest making htmLawed the last filter to be run.

federico’s picture

I tried this way, but it keeps removing </P><P>

This is the list of my filters (ordered like they are on my site)
-10: Line-break converter
-5: URL Filter
0: HTML Filter
5: Quote filter
10: htmLawed (X)HTML filter/purifier

Thanks

alpha2zee’s picture

Have you tried adding 'p' to the list of allowed elements? To do so, edit the 'Config.' form field values so that 'p' is in the comma-separated tag-list (the values will look like "...em, strong, ..., p, ...").

federico’s picture

'p' is already in the list of allowed tags. <br> <p> <a> <em> <i> <strong> <b> <cite> <ul> <ol> <li> <dl> <dt> <dd> <!--break--> <h2> <h3> <h4> <h5> <h6> <quote> <blockquote> <cite> <title> <code> <sub> <sup>

Thanks

alpha2zee’s picture

It seems, then, that the filters which run before htmLawed pass on the '</p><p>' intact, and htmLawed sees the first '</p>' and removes it (closing tag without a preceding opening tag). If it is so, I don't know what can be done about this (one possibility is to have the input begin with a '<p>').

What is the WYSIWYG module you are using? Can I get it somewhere to try to figure out this issue? I am quite sure that there's nothing wrong in htmLawed's logic per se.

federico’s picture

Thanks,

<P> is at the beginning of the input. This is the code passed to htmlLawed

<P>line 1</P><P>line 2</P>

htmlLawed transform this to:

<p>line 1line 2</p>

I'm using jWYSIWYG. This editor issue has been posted to http://code.google.com/p/jwysiwyg/issues/detail?id=111 . This can be solved using another WYSIWYG editor, but I think htmlLawed should be useful for this also.

I'm using jWYSIWYG with Wysiwyg module

Thanks

alpha2zee’s picture

My setup: PHP 5.2, Mac OS 10.5, Firefox 3.5; latest Drupal 6, and htmLawed and Wysiwyg modules (no other module); jWysiwyg 0.5; input format has line-break converter at weight -5 and htmLawed at weight 10 (no other filter).

Since jWysiwyg/line-break converter generates 'br', and 'span' with 'style' attribute, htmLawed has to be configured to permit them (in default setting, they are not). Ensure 'span' and 'br' are allowed in elements and 'style' is not a denied attribute in the 'Config.' form-fields. E.g.,

'safe'=>1, 'elements'=>'a, em, strong, cite, code, ol, ul, li, dl, dt, dd, p, br, span', 'deny_attribute'=>'id'

With these, I am not seeing any issue though I think jWysiwyg may not be producing good HTML at least on Mac/Firefox.

As for the '</p><p>' issue, I find that htmLawed is passed '</p><p>' entitified (i.e., '&lt;/p&gt;&lt;p&gt;' and it leaves that as such.

Overall, I feel this is a jWysiwyg issue. Please comment.

federico’s picture

Status: Active » Closed (fixed)

Thanks a lot,

'p' and 'br' where not allowed, now it's working fine. (my fault, i should have checked that before).

You are right that jWysiwyg is not producing good html, I use it just because it's small and simple. Curiously, with Opera it's producing uppercase tags, and with Firefox lowercase tags. In Opera (opera 10.00, ubuntu 9.04, drupal 5), htmlLawed is not transforming uppercase to lowercase, anyway, it's not so important and I don't know if this is a feature of htmlLawed, so I'm closing this issue.

Thanks a lot for your time alpha2zee