Recent Topics

The Auto P malfunction

Started by on Jun 29, 2019 – Contents updated: Jul 08, 2019

Jun 29, 2019 20:26    

Carrying on from an earlier post https://forums.b2evolution.net/multiple-insertion-of-lpglbrgl-pg which refers to another I have noticed an indentation a couple of times but ignored it.

Whilst editing a post https://calstock.org.uk/2013/06/11/mains-water-usage the new list item June 28/29th is indented.

The Auto P  malfunction

In the back office I copied the line starting May 20th, including the <li> </li>tag then edited the text.

I checked out the source and found the text in the list was enveloped in a <p> tag.

I then created a new list item with random text, and all was fine so I then edited that line by adding the previous item's text and all is ok.

I then disabled Auto P and the indent disappeared, but reappeared upon re-enabling.

I have left Auto P enabled so you can see it and the source code.

Jul 04, 2019 17:18

@amoun please screenshot the backoffice editor when editing this.

Show if you are in WYSIWYG or Markup mode.

Then please switch to Markup mode and copy paste the whole source into a [code block lang="markup" line="1"]...[/codeblock] here.

(when you do it, remove space between [code and block)

Jul 07, 2019 23:30

Hi @fplanque

  1. I never use WYSIWYG

I have just gone back to the post to edit it and removed all spaces and new lines, I usually have each item on a new line.

<ul><li><strong>May 20th</strong> From  <span class="MT_yellow_back">62.5671</span> to 63.8371. First use this year. Only 20ml diff from last record (yellow)</li><li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup></li><li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup></li></ul>

and everything is fine, but I noticed in removing all the spaces and new lines that there was a new line before the closing tag of second list item. I have replicated it in the next code.
<ul><li><strong>May 20th</strong> From  <span class="MT_yellow_back">62.5671</span> to 63.8371. First use this year. Only 20ml diff from last record (yellow)</li><li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup>
</li><li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup></li></ul>

This new line before the closing tag </li> makes that list item seem like a new paragraph to Auto P somehow.

I haven't done a screen shot of the back office editor as it seems clear where the issue lies, and the Auto P is checked.

Hope this reply is ok though not exactly what you asked for.

So this code is fine.

<ul>
<li><strong>May 20th</strong> From  <span class="MT_yellow_back">62.5671</span> to 63.8371. First use this year. Only 20ml diff from last record (yellow)</li>
<li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup></li>
</ul>

and this causes and indent.
<ul>
<li><strong>May 20th</strong> From  <span class="MT_yellow_back">62.5671</span> to 63.8371. First use this year. Only 20ml diff from last record (yellow)</li>
<li><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup>
</li>
</ul>

Jul 07, 2019 23:45

Clearly, having a newline at that position is not something we are trying to support in the Auto P plugin.

Again the Auto P plugin is primarily designed for plain text and supports a little bit of cooperative HTML. Putting a newline before a closing tag when there is none after the opening tag is definitely not cooperative HTML.

Jul 07, 2019 23:46

The source code for the indented case, via Firefox > Developer >Source code is:

<ul>
<li><strong>May 20th</strong> From  <span class="MT_yellow_back">62.5671</span> to 63.8371. First use this year. Only 20ml diff from last record (yellow)</li>
<li><p><strong>June 28/29th</strong> From  <span class="MT_yellow_back">63.8376</span> to 65.7269. Left tap on for 24hrs. and although 2m<sup>3</sup> have been used I doubt I used even 1m<sup>3</sup></p>
</li>
</ul>

So Auto P adds a paragraph when the closing tag is on a new line.

Jul 07, 2019 23:48

Clearly, having a newline at that position is not something we are trying to support in the Auto P plugin.

Again the Auto P plugin is primarily designed for plain text and supports a little bit of cooperative HTML. Putting a newline before a closing tag when there is none after the opening tag is definitely not cooperative HTML.

It wasn't intentional just another example of my untidiness.

Thanks for helping me keep on the case.

Jul 07, 2019 23:49

ditto; same answer as above ;)

Jul 08, 2019 00:38

Just thinking about it a bit more and I know where it comes from.
Way back in the 90's all tags had an ending tag on a new line at the same indentation as it was easier to follow where tags ended, rather than following lines of text to see where and if there was one.

<html>
  <head>
  </head>
  <body>
    <ul>
      <li>
        Some text.
      </li>
     <li>
       <ol>
         <li>
           Item 1
         </li>
         <li>
           Item 2
         </li>
       </ol>
     </li>
   </ul>
  </body>
</html>
 


Form is loading...

CMS software – This forum is powered by b2evolution CMS, a complete engine for your website.