Skip to main content
Topic: List Bug in Post (1.1) (Read 2095 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

List Bug in Post (1.1)

  • Testing
  • 123

Well, the error is that you post up a list.. and voila beautiful.. it's there..

But when you click modify, then you will see that it now says list type = none....

Then when you save it again, obviously the list disappears. No squares..

  • But this only happens when you click the square lists though..
  • Meaning that it can't save lists which do not have type explicitly stated?

You can try modifying my post to see the effect.. Or simply try it out yourself! :(

Facta, non verba.

Re: List Bug in Post (1.1)

Reply #1

  • Testing
  • 123

Apparently:
Code: [Select]
/* Set list-style to none by default. Best in most places.*/
ul, ol {
list-style: none;
}
kicks in and overrides the default style and sceditor picks that one for the list...even though in fact it should not.
Last Edit: July 10, 2016, 01:15:28 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: List Bug in Post (1.1)

Reply #2

After some testing, I would propose to:
Code: [Select]
diff --git a/themes/default/css/index.css b/themes/default/css/index.css
index cac2546..938d429 100644
--- a/themes/default/css/index.css
+++ b/themes/default/css/index.css
@@ -805,8 +805,8 @@ strong, .bbc_strong {
 
 .bbc_list {
  padding: 0 0 0 35px;
- list-style-type: square;
- text-align: left;
+ list-style-type: disc;
 }
 
 /* Everything is same except HTML5 valid */
diff --git a/themes/default/scripts/jquery.sceditor.elkarte.js b/themes/default/scripts/jquery.sceditor.elkarte.js
index e19f2f8..4b5a5fd 100644
--- a/themes/default/scripts/jquery.sceditor.elkarte.js
+++ b/themes/default/scripts/jquery.sceditor.elkarte.js
@@ -537,7 +537,7 @@ $.sceditor.plugins.bbcode.bbcode
 
  if (attrs.type)
  style = 'style="list-style-type: ' + attrs.type + '"';
- return '<' + code + ' ' + style + '>' + content + '</' + code + '>';
+ return '<' + code + ' class="bbc_list" ' + style + '>' + content + '</' + code + '>';
  }
  })
  .set('li', {
@@ -556,7 +556,7 @@ $.sceditor.plugins.bbcode.bbcode
  },
  isInline: false,
  skipLastLineBreak: true,
- html: '<ul>{0}</ul>'
+ html: '<ul class="bbc_list">{0}</ul>'
  })
  .set('ol', {
  tags: {

It seems to fix the issue here.
Bugs creator.
Features destroyer.
Template killer.

Re: List Bug in Post (1.1)

Reply #3

If I would like to temporarily fix the Beta 1.1 version I have, which part of the code should I change?

I don't really get the code you have typed out.. :(
Facta, non verba.

Re: List Bug in Post (1.1)

Reply #4

themes/default/css/index.css:
From
Code: [Select]
 .bbc_list {
  padding: 0 0 0 35px;
list-style-type: square;
text-align: left;
 }
to:
Code: [Select]
 .bbc_list {
  padding: 0 0 0 35px;
list-style-type: disc;
 }

themes/default/scripts/jquery.sceditor.elkarte.js:
from:
Code: [Select]
return '<' + code + ' ' + style + '>' + content + '</' + code + '>';
to:
Code: [Select]
return '<' + code + ' class="bbc_list" ' + style + '>' + content + '</' + code + '>';

and from:
Code: [Select]
html: '<ul>{0}</ul>'
to:
Code: [Select]
html: '<ul class="bbc_list">{0}</ul>'
Bugs creator.
Features destroyer.
Template killer.

 

Re: List Bug in Post (1.1)

Reply #5

HOORAY IT WORKS! :D :D :D
Facta, non verba.