I've been trying to get this to work for hours now with little success. I have tried many, if not most of the configurations listed in the documentation as well as on http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/exa... with little success. No matter what I add, this is what I get:

<p><span><span>Agenda for Saturday Feb 8th Meeting</span><br>
<span>Vision</span><span>Critical Path for TSG &amp; each of us</span><span>Email Communications</span><span>Sales funnel (initial contact, follow up)</span><span>Affiliate emails</span><span>Implementation Course emails</span><span>Support Group emails</span><span>Gems draft review -----Well, we can probably skip this now. &nbsp;It is clear that we will have to make fresh content.</span><span>affiliate items &amp; program</span></span></p>

When I disable htmLawed, I get this:

<h1 dir="ltr" style="line-height:1.15;margin-top:10pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="font-size: 21px; font-family: 'Trebuchet MS'; color: rgb(0, 0, 0); vertical-align: baseline; white-space: pre-wrap;">Agenda for Saturday Feb 8th Meeting</span></span></h1>

<p>&nbsp;</p>

<ul style="margin-top:0pt;margin-bottom:0pt;">
	<li dir="ltr" style="list-style-type: disc; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
	<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Vision</span></span></p>
	</li>
	<li dir="ltr" style="list-style-type: disc; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
	<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Critical Path for TSG &amp; each of us</span></span></p>
	</li>
	<li dir="ltr" style="list-style-type: disc; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
	<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Email Communications</span></span></p>

	<ul style="margin-top:0pt;margin-bottom:0pt;">
		<li dir="ltr" style="list-style-type: circle; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
		<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Sales funnel (initial contact, follow up)</span></span></p>
		</li>
		<li dir="ltr" style="list-style-type: circle; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
		<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Affiliate emails</span></span></p>
		</li>
		<li dir="ltr" style="list-style-type: circle; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
		<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Implementation Course emails</span></span></p>
		</li>
		<li dir="ltr" style="list-style-type: circle; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
		<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Support Group emails</span></span></p>
		</li>
	</ul>
	</li>
	<li dir="ltr" style="list-style-type: disc; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
	<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">Gems draft review -----Well, we can probably skip this now. &nbsp;It is clear that we will have to make fresh content.</span></span></p>
	</li>
	<li dir="ltr" style="list-style-type: disc; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); vertical-align: baseline;">
	<p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="vertical-align: baseline; white-space: pre-wrap;">affiliate items &amp; program</span></span></p>
	</li>
</ul>

When I leave the config field empty on the text format page I get this:

<p>Agenda for Saturday Feb 8th Meeting</p>
<ul>
	<li dir="ltr">Vision</li>
	<li dir="ltr">Critical Path for TSG &amp; each of us</li>
	<li dir="ltr">Email Communications</li>
	<li dir="ltr">Sales funnel (initial contact, follow up)</li>
	<li dir="ltr">Affiliate emails</li>
	<li dir="ltr">Implementation Course emails</li>
	<li dir="ltr">Support Group emails</li>
</ul>
<p>Gems draft review -----Well, we can probably skip this now. &nbsp;It is clear that we will have to make fresh content.affiliate items &amp; program</p>

The last option is actually the closest to what I want, but it's still replacing the h1 tags with p tag, among other things.

So literally as soon as I add ANYTHING to the config field I get option 1. I have tried adding
'elements'=>'a, b, blockquote, br, div, em, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, span, strong, u, ul', 'safe'=>1, 'deny_attribute'=>'id, class, style'
or
'schemes'=>'*:*'
or
'deny_attribute'=>'id, style'
or
'safe'=>1, 'elements'=>'a, em, strong'
or or or or or (You get the idea)

So what am I doing wrong?

Thanks

Comments

alpha2zee’s picture

Assigned: Unassigned » alpha2zee

I tested your input with the standalone htmLawed software. On the linked htmLawed test site, I also tried the Config. settings you note. The output is fine without the issue that you see with the Drupal htmLawed module. So this does not appear to be an htmLawed issue per se. I do not have an accessible Drupal 7 setup at this moment to test if the issue is in the Drupal htmLawed module.

I assume you are using the current version of the Drupal module (currently same as the dev version). The current htmLawed software is at version 1.1.17; to use it, download the htmLawed.php file and replace the one in your Drupal htmLawed module directory; may be this will fix the issue (unlikely).

Can you tell me if there is any other format filter in use and if so, what is it, and is it used before the htmLawed filter? What happens if you disable such other format filter?

deggertsen’s picture

Thanks for your quick response. I realize this is probably a frustrating issue as it indeed does work fine at the test site that you referred to. I guess I was just hoping that this was something somebody may have seen before.

I am using the most recent version 3.3 (which like you said is currently equal to dev).
I am using CKeditor, but a just double checked to make sure all filtering in CKeditor was disabled and it is.
I'm using the pasteformat module so that I can actually pull the filter where I have htmLawed enabled. htmLawed is the ONLY filter I have enabled in my paste format.

I'm really at a loss for what may be causing the problem. I've even tried uninstalling everything and re-installing.

I've switched to using HTML Purifier now since I'm able to get that one to work.

Thanks

alpha2zee’s picture

I have now tried to replicate your Drupal setup to test this issue. But I am not able to replicate the issue.

This may be because you are probably actually pasting formatted text in the CKEditor editor's WYSIWYG window while I am pasting HTML code in CKEditor in the Source mode. (I don't have the formatted text that you have to paste.)

Please take a look at the details delow on my setup and attempt to replicate the issue. I am not familiar with either the CKEditor or the Paste Format Drupal modules.

Secondly, you wrote that htmLawed is the ONLY filter I have enabled in my paste format. You probably misunderstood me. We specify a text format for use with Paste Format. A text format can use one or more filters, htmLawed being such a filter. What I am asking is if htmLawed is the only filter in use for the text format that has been enabled for Paste Format?

-----

My setup was as follows:

  • Fresh basic installation of current release version of Drupal (7.27)
  • Installed and enabled current release versions of CKEditor (7.x-1.3) htmLawed (7.x-3.3), and Paste Format (7.x-1.5) Drupal 7 modules; for CKEditor module, using current release version of CKEditor Standard editor software (4.3.4)
  • Created a new text format, allowed its use for both anonymous and authenticated user roles, and set it to use only htmLawed. The default Config. value for htmLawed was changed to 'elements'=>'a, b, blockquote, br, div, em, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, span, strong, u, ul', 'safe'=>1, 'deny_attribute'=>'id, class, style'
  • The Paste Format module was configured to use the new text format (Text format to clean up pasted text = the new format). Use of Paste Format was permitted for both anonymous and authenticated user roles.
  • The Full CKEditor profile was edited to allow use of the new text format and the Paste Format module (Editor appearance > Plugins > Paste Format: Plugin to cleanup pasted text selected). The Advanced CKEditor profile was deleted to keep things simple.
  • All other Drupal or the above-mentioned Drupal module settings were left unaltered

To try to replicate your issue, I created a new content-type with default Drupal settings and then created a new content for the content type. In the Body field, selected Source button in the CKEditor editor window's toolbar, and pasted the text input (the example you provided):

<h1 dir="ltr" style="line-height:1.15;margin-top:10pt;margin-bottom:0pt;"><span id="docs-internal-guid-184c2e93-783f-e8be-2226-bf2b0665d09c"><span style="font-size: 21px; font-family: 'Trebuchet MS'; color: rgb(0, 0, 0); vertical-align: baseline; white-space: pre-wrap;">Agenda for Saturday Feb 8th Meeting</span></span></h1>
<p>&nbsp;</p>
<ul style="margin-top:0pt;margin-bottom:0pt;">
<li... [snipped]

The new content was saved. To check the effect of filtering, I chose to edit the new content, and in the Bodyfield, selected Source button in the CKEditor window's toolbar. The displayed text was:

<h1>Agenda for Saturday Feb 8th Meeting</h1>

<p>&nbsp;</p>

<ul>
	<li>
	<p>Vision</p>
	</li>
	<li>
	<p>Critical Path for TSG &amp; each of us</p>
	</li>
	<li>
	<p>Email Communications</p>

	<ul>
		<li>
		<p> [snipped]

The h1 tag was present and so were li, etc.

alpha2zee’s picture

Title: All HTML tags converted to <span> » All HTML tags converted to 'span' (htmLawed with CKEditor / Paste Format module)

I have now tried to better replicate the issue by directly pasting formatted text from a Word document into the CKEditor's editor WYSIWYG window. After pasting, but before saving the content, I used the Source button of the editor to view the HTML code (below, and same as the code after saving the content). The htmLawed filtering that occurred because of Paste Format being in effect, did not mangle the h1, li, etc. tags.

<h1><a name="_GoBack"></a>Agenda for Saturday Feb 8th Meeting</h1>

<ul>
	<li>Vision</li>
	<li>Critical Path for TSG &amp; each of us</li>
	<li>Email Communications
	<ul>
		<li>Sales funnel (initial contact, follow up)</li>
		<li>Affiliate emails</li>
		<li>Implementation Course emails</li>
		<li>Support Group emails</li>
	</ul>
	</li>
	<li>Gems draft review... [snipped]
deggertsen’s picture

So if I understand you correctly, you have confirmed the issue? If others are not experiencing this same issue I am happy to close it as I have found a solution that is working for me.

alpha2zee’s picture

Sorry, no, I could not replicate (confirm) the issue in my set up. Everything worked as expected. Rich, formatted content with h1, li, etc. tags when directly pasted in CKEditor's WYSIWYG window was handled appropriately by Paste Format with htmLawed; htmLawed filter was configured to allow h1, etc., and it did not remove or convert those tags.

So I cannot say why your setup has this issue. The only thing I can think of is that there is some other filtering occurring... perhaps there is another filter besides htmLawed for the input format that Paste Format is using, or the CKEditor is configured to do some non-default text processing.

deggertsen’s picture

Status: Active » Closed (cannot reproduce)

Right, it definitely seems like one of those things you mention would be the issue, but when I was trying to make it work I went through the text format to ensure that htmLawed was the only thing checked and I also went through CKEditor's settings to make sure all filter was turned off. Not sure why HTML Purifier is working for me when htmLawed didn't (I didn't change any settings other than unchecking the box for htmLawed and checking the one for HTML Purifier).

I'm closing this issue as there is no reason to troubleshoot it any further unless someone else is able to reproduce the problem.

Thanks for being so responsive and helpful though!