Headers not parsed correctly without line ending

JanVanC - July 9, 2009 - 08:19
Project:Table of Contents
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:AlexisWilke
Status:closed
Description

The content table is not build up correctly when there is no CR/LF given at the end of the header. Unfortunately this is what the WYSIWYG editor produces. It sees everything that follows after the header as the header itself.

this goes wrong:

<p>testintro</p> <p></p> <p>testinro</p> <p>[toc]</p> <h2>test kop2</h2> <p>teststd</p> <h3>test kop2 nog eens</h3> <p>gsdfsdfsdfsdf</p> <h2>test kop2 nog een keer</h2> <p>sdcasdasdasdasd</p> <p>aasdasd</p> <p>&nbsp;</p>

it outputs as (note that everything is wrapped inside the first link!!!):

    
Inhoudsopgave

<ul>

<li class="toc-level-1"><a href="#test_kop2h2_pteststdp_h3test_kop2_nog_eensh3_pgsdfsdfsdfsdfp_h2test_kop2_nog_een_keer">test kop2 <p>teststd</p> <h3>test kop2 nog eens</h3> <p>gsdfsdfsdfsdf</p> <h2>test kop2 nog een keer</h2></a></li>
</ul>

<h2 id="test_kop2h2_pteststdp_h3test_kop2_nog_eensh3_pgsdfsdfsdfsdfp_h2test_kop2_nog_een_keer">test kop2</h2> <p>teststd</p> <h3>test kop2 nog eens</h3> <p>gsdfsdfsdfsdf</p> <h2>test kop2 nog een keer</h2> <p>sdcasdasdasdasd</p> <p>aasdasd</p> <p>&nbsp;</p>  </div>

this works fine:

<p>testintro</p>
<p></p>
<p>testinro</p>
<p>[toc]</p>
<h2>test kop2</h2>
<p>teststd</p>
<h3>test kop2 nog eens</h3>
<p>gsdfsdfsdfsdf</p>
<h2>test kop2 nog een keer</h2>
<p>sdcasdasdasdasd</p>
<p>aasdasd</p>
<p>&nbsp;</p>

this correctly outputs as

<p>testinro</p>

Inhoudsopgave

<ul>
<li class="toc-level-1"><a href="#test_kop2">test kop2</a>
<ul>
<li class="toc-level-2"><a href="#test_kop2_nog_eens">test kop2 nog eens</a></li>
</ul>
</li><li class="toc-level-1"><a href="#test_kop2_nog_een_keer">test kop2 nog een keer</a></li>
</ul>


<h2 id="test_kop2">test kop2</h2>
<p>teststd</p>
<h3 id="test_kop2_nog_eens">test kop2 nog eens</h3>
<p>gsdfsdfsdfsdf</p>
<h2 id="test_kop2_nog_een_keer">test kop2 nog een keer</h2>
<p>sdcasdasdasdasd</p>
<p>aasdasd</p>
<p>&nbsp;</p>  </div>

#1

AlexisWilke - July 9, 2009 - 08:28
Assigned to:Anonymous» AlexisWilke

Did you use version 2.x? Was it working in 2.x?

I use FCKeditor and it automatically puts new lines after headers (among other things!)

#2

JanVanC - July 9, 2009 - 13:20

I have only discovered this module today.
I first installed 3.0 and I believe it did not have that problem.
I would like to use the [toc] syntax with the wysiwyg editor and that is why I decided to try the dev release...

For your reference, I am using Wysiwyg 6.x-2.0 with TinyMCE 3.2.4.1
For some reason it always cleans up crlf even if you simply open and save the node. I haven't found a way to prevent it from doing that.
Switching editor now will probably confuse my editors.

I really like this module! nice work!

#3

JanVanC - July 9, 2009 - 14:22

FYI
I changed the settings in TinyMCE to disable 'remove linebreaks'. In that case the manually added line ends (added with the rich text editor disabled) are no longer removed.
However TinyMCE does not add CRLF to new headers/paragraphs being added. So it is still problematic...

#4

AlexisWilke - July 9, 2009 - 18:29

Okay, I added some greedy operators to attempt to fix this problem.

If you would try with the newer version (wait till it says Jul 9, 2009).

Thank you.
Alexis

#5

JanVanC - July 10, 2009 - 07:01

I tried it this morning and it seems to do the job.

Thanks a lot for your superfast response!
Jan

#6

AlexisWilke - July 10, 2009 - 07:04
Status:active» fixed

Well this was a bad one 8-)

Thank you.
Alexis Wilke

#7

System Message - July 24, 2009 - 07:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.