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

Readability removes headings when they have a link in them #85

Open
kolaente opened this issue Feb 18, 2024 · 0 comments
Open

Readability removes headings when they have a link in them #85

kolaente opened this issue Feb 18, 2024 · 0 comments

Comments

@kolaente
Copy link

It looks like Readability removes headlines like this:

<h2 class="header-with-anchor-widget">1. A mental model of the software engineering cycle
    <div id="§a-mental-model-of-the-software-engineering-cycle" class="header-anchor-widget offset-top">
        <div class="header-anchor-widget-button-container">
            <div class="header-anchor-widget-button" href="https://newsletter.pragmaticengineer.com/i/136465585/a-mental-model-of-the-software-engineering-cycle"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="header-anchor-widget-icon"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div>
        </div>
    </div>
</h2>

This is a valid (as in, we want to preserve it as content) headline, it just contains an extra <div>.
It seems to be removed in

protected function grabArticle(\DOMElement $page = null)
.

Is there a way to control this behaviour? Ideally, Readability would keep the headline but remove the extra div.

Taken from this article, looks like all substack publications use the same markup.

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

1 participant