I am using collapsed text in a page containing PayPal buttons. I tried adding
[collapse options form="noform"]
at the beginning of the document but was still seeing the form tag added at the beginning of the page by collapse text.
I believe the problem is caused by CKEditor (and previously FCKEditor) adding paragraph tags around all lines. If I switch to plain text editing and remove the paragraph tags around the options line, I can save the page and have it render properly. However, any subsequent edits causes the options line to be ignored.
CKEditor also appears to change the quote marks to HTML characters:
[collapse options form="noform"]
This causes the options line to be ignored as well.
I am running Drupal 6.22. I added Collapse Text to the Full HTML input filter. The order of filters are:
- URL filter
- Line break converter
- HTML converter
- Collapse text
- Insert node
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | collapse-text-1214186-04.patch | 403 bytes | nhoeller |
Comments
Comment #1
nhoeller commentedA colleague who is proficient in regex had a look at the code. Dumping the arguments to the _collapse_text_check_otions_ function suggests that the code is handling paragraph tags properly. The code may not be handling the form option when the rich text editor changes double-quotes to " as in
<p>[collapse options form="noform"]</p>I am currently using CKEditor but first ran into this problem with FCKEDitor.
Comment #2
Haily commentedFor problems with CKEditor messing with my code, I just created a second text format called "full html (no editor)," it's just a clone of the first just without CKEditor. It's quick and easy to change text formats in web forms, so it works well with me.
Comment #3
nhoeller commentedUnfortunately, the page in question contains a lot of complex formatting that I would rather not do by hand. I have patched the code to translate
"back to a double-quote during the conversion of HTML to XML entities. The patch seems to work although I do not understand the code well enough to determine whether the patch might have side-effects.Comment #4
nhoeller commentedI traced the problem to the function _collapse_text_check_options. By default, CKEditor maps many characters to HTML entities (Advanced Options setting in the CKEditor profiles). The simplexml_load_string function fails if it is called with an argument containing
".The attached patch updates the function _collapse_text_html_to_xml_entities so that it maps
"back to a double-quote. I tried mapping it to"but that did not seem to work.So far, I have not run into any side-effects from the change, but freely admit that my knowledge of XML is limited.
Comment #5
AlexisWilke commentedHi nhoeller,
I have a similar problem as I'm using FCKEditor and get " instead of ". A simple str_replace() does the trick for me. But your patch is a good way of fixing the problem in the new version of the module.
Thank you.
Alexis
See: #1120066: Support for width="123px"
Comment #6
pukku commentedHi! The problem with this is that there is then no way to put a quote into a title. I'm marking this as a duplicate of #1120066 because it is the same problem.