Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix list item formatting for lists with paragraphs #1283

Merged
merged 1 commit into from
Dec 16, 2019
Merged

Fix list item formatting for lists with paragraphs #1283

merged 1 commit into from
Dec 16, 2019

Conversation

nilium
Copy link
Contributor

@nilium nilium commented Dec 2, 2019

This removes the fancy tick-mark next to unordered list items, which is
a little depressing, but fixes formatting for them when they contain
paragraphs (<p> elements). The tick-mark has been replaced with
a square mark. Both ordered and unordered lists have grown 1rem of left
padding to compensate for their position.

Considered using disclosure-closed as a similar triangle replacement,
but it's not regarded as something that should be used in production
(per MDN). Using a simple string is unsupported because it's only in
a CSS working draft, so a square is the least controversial option,
I think.

Closes #1282.

@auto-assign auto-assign bot requested a review from NGPixel December 2, 2019 20:27
This removes the fancy tick-mark next to unordered list items, which is
a little depressing, but fixes formatting for them when they contain
paragraphs (`<p>` elements). The tick-mark has been replaced with
a square mark. Both ordered and unordered lists have grown 1rem of left
padding to compensate for their position.

Considered using disclosure-closed as a similar triangle replacement,
but it's not regarded as something that should be used in production
(per MDN). Using a simple string is unsupported because it's only in
a CSS working draft, so a square is the least controversial option,
I think.

Closes #1282.
@nilium
Copy link
Contributor Author

nilium commented Dec 2, 2019

Attaching a screenshot of Firefox (Chrome looks the same, so didn't bother capturing that, but can if needed) with the changes to contrast the current behavior in #1282.

screenshot-20191202-122637

And the markdown from above:

## Separated by Newlines

1. Simple list

2. Each item is a paragraph

    1. Nested ordered list.
    
    2. Check that these work as expected--
    
        Even when nested.

3. Because each item is separated by a line

## Multi-line list

  - This list contains items with multiple lines, requiring paragraphs in the list item.

    That is, the list item is more complicated than just `<li>Test</li>`.
  - Once an item in a list is a paragraph, all items are paragraphs.
  - This also contains a paragraph.

      - Nested
      - List items
      
          To test with.
      - Because they matter too.

    Just to illustrate this mid-list.
  - Another paragraph.

## Simple List

  - This list works.
  - It isn't separated by newlines.
  - It doesn't have multiple lines in any item.

@NGPixel NGPixel added the under review Acknowledged, awaiting further review label Dec 15, 2019
@NGPixel NGPixel merged commit d407312 into requarks:master Dec 16, 2019
@hinaloe
Copy link
Contributor

hinaloe commented Dec 17, 2019

This commit make effect to {.links-list}.

image

@nilium
Copy link
Contributor Author

nilium commented Dec 17, 2019

Should be possible to make a small adjustment to handle that. At least as CSS changes go, it’s not too bad of a break. Not sure if you want to do the PR for it, since I don’t have WikiJS set up for dev locally right now.

@nilium nilium deleted the issue-1283/list-bullet-styling branch December 17, 2019 01:18
@takashi1kun
Copy link
Contributor

takashi1kun commented Jan 22, 2020

I mean, i'm not an expert in css, but wouldn't this be solved whit just a css rule like

.v-content  ul > li > p {
    display: inline-flex;
}

or for more compatibility with old browsers:

.v-content ul > li > p {
    display: inline-table;
}

or for even more compatibility with old browsers:

.v-content ul > li > p {
    display: inline-block;
    vertical-align: top;
    padding-top: 0px;
}

this makes so it wraps the "p" element in the li and you still have the fancy bullets, and as a bonus this doesn't break link-lists

UPDATE:
So i kinda found some bugs when there is multiline but not p element with my css, but is still possible, with not as much browser compatibility but is still compatible with firefox, chrome, opera and edge:

.v-content ul {
width: 100%;
}
.v-content ul>li {
display:flex;
flex-wrap: wrap;
}
.v-content ul>li>p{
display:inline-block;
vertical-align:top;
padding-top:0!important;
}

takashi1kun added a commit to takashi1kun/wiki that referenced this pull request Jan 22, 2020
In kinda response to: requarks#1283 
Solves the problem with the list having issues with p elements and with multi lines but keeping the fancy css bullets.
Tested on Chrome, Firefox, Opera and Edge.
NGPixel added a commit that referenced this pull request Feb 1, 2020
* Fix list formatting multiline with fancy bullets

In kinda response to: #1283 
Solves the problem with the list having issues with p elements and with multi lines but keeping the fancy css bullets.
Tested on Chrome, Firefox, Opera and Edge.

* remove important

* fix: bullet symbol for RTL

Co-authored-by: Nicolas Giard <github@ngpixel.com>
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
This removes the fancy tick-mark next to unordered list items, which is
a little depressing, but fixes formatting for them when they contain
paragraphs (`<p>` elements). The tick-mark has been replaced with
a square mark. Both ordered and unordered lists have grown 1rem of left
padding to compensate for their position.

Considered using disclosure-closed as a similar triangle replacement,
but it's not regarded as something that should be used in production
(per MDN). Using a simple string is unsupported because it's only in
a CSS working draft, so a square is the least controversial option,
I think.

Closes requarks#1282.
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
* Fix list formatting multiline with fancy bullets

In kinda response to: requarks#1283 
Solves the problem with the list having issues with p elements and with multi lines but keeping the fancy css bullets.
Tested on Chrome, Firefox, Opera and Edge.

* remove important

* fix: bullet symbol for RTL

Co-authored-by: Nicolas Giard <github@ngpixel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under review Acknowledged, awaiting further review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lists containing paragraphs are styled incorrectly
4 participants