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

Space between lines in bulleted lists #496

Open
dicook opened this issue Sep 28, 2023 · 1 comment
Open

Space between lines in bulleted lists #496

dicook opened this issue Sep 28, 2023 · 1 comment

Comments

@dicook
Copy link

dicook commented Sep 28, 2023

Consider the following .Rmd

---
title: "bulleted list issues"
---

## Good bullets

- one
- two
- three

## Bad bullets

-   one blah

-   two what

-   three

When rendered to html_document the "bad" bullets have a blank line between each bullet point, which is read as "empty line" by screen readers.

When rendered to rjtools::rjournal_web_article both sets of bullet points have a blank line between each bullet point.

It would be good if the rjtools style did not introduce blank lines in the first case (and authors were encouraged to use this form). The blank lines appear to be due to

tags nested within

  • tags.

    Originally posted by @ajrgodfrey and @hturner at Avoid new lines in bulleted lists rjournal/rjtools#102 (comment)

  • @cderv
    Copy link
    Collaborator

    cderv commented Sep 28, 2023

    This is how it looks
    image

    By "have a blank line between each bullet point", you are referring to the styling in browser as in image above ?

    The line space between bullet is the result of margin at bottom for li element

    d-article li {
        margin-bottom: 1em;
        margin-left: 0;
        padding-left: 0;
    }

    which is inserted by Distill JS itself.

    This is the HTML we get

    <h2 id="good-bullets">Good bullets</h2>
    <ul>
    <li>one</li>
    <li>two</li>
    <li>three</li>
    </ul>
    <h2 id="bad-bullets">Bad bullets</h2>
    <ul>
    <li><p>one blah</p></li>
    <li><p>two what</p></li>
    <li><p>three</p></li>
    </ul>

    As discussed in original issue (Abhi-1U/texor#60 (comment)), the loose list have <p> introduce on purpose by Pandoc

    So for rjtools, unless you are tweaking something there, it should be the same HTML and than same CSS rule.

    which is read as "empty line" by screen readers.

    I don't know what exactly is not correct for screen readers. It would be really good to understand that to see what is the mistake in there 🤔

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants