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

Unnecessary <div> elements #55

Open
jemrobinson opened this issue Jan 31, 2019 · 1 comment
Open

Unnecessary <div> elements #55

jemrobinson opened this issue Jan 31, 2019 · 1 comment
Labels
bug Something isn't working future Needs revisiting in the future

Comments

@jemrobinson
Copy link
Member

jemrobinson commented Jan 31, 2019

In some cases, there are several wrapping levels of <div> in the ReadabiliPy output. These should be flattened.

The rationale behind this, is that the output of ReadabiliPy should (ideally) not depend on how deeply wrapped in <div>s the input is.

If we go down this route, we should think about which types of tag can be safely stripped out (eg. <div> and <span> are fine, but <table> or <figure> probably aren't).

@jemrobinson jemrobinson added the bug Something isn't working label Jan 31, 2019
@jemrobinson
Copy link
Member Author

jemrobinson commented Jan 31, 2019

Example:

<div class="wrapper">
    <div class="article">
        <div id="advert"></div>
        <div class="formatted">
            <p>First paragraph contents.</p>
        </div>
    </div>
</div>

Could/should be reduced to:

<div>
    <p>First paragraph contents.</p>
</div>

What do you think @martintoreilly ? Note that if you add another paragraph you get the following structure:

<div class="wrapper">
    <div class="article">
        <div id="advert"></div>
        <div class="formatted">
            <p>First paragraph contents.</p>
        </div>
        <div class="formatted">
            <div class="aside">
                <p>Second paragraph contents.</p>
            </div>
        </div>
    </div>
</div>

would be reduced to

<div>
    <p>First paragraph contents.</p>
    <p>Second paragraph contents.</p>
</div>

@jemrobinson jemrobinson added the future Needs revisiting in the future label May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working future Needs revisiting in the future
Projects
None yet
Development

No branches or pull requests

1 participant