Clipping to MD does not clip all `a` elements

In another thread, I was led to a web document whose “cluttered” MD clip lacks (at least) the final three links.
The URL: A Practical Introduction to Web Scraping in Python – Real Python

The last three links:

The preview of the MD document as clipped to DT (There’s nothing after the last line shown here!):

The (end of the) source of the MD document as clipped to DT:

## Additional Resources

For more information on web scraping with Python, check out the following resources:


As you can see, the original links are not there, only reference links from the rest of the document. This is, let’s say, unfortunate. One would expect the whole document to be clipped, especially in cluttered mode. Especially, since the HTML does nothing weird:

<li><a href="">Beautiful Soup: Build a Web Scraper With Python</a></li>
<li><a href="">API Integration in Python</a></li>
<li><a href="">Python &amp; APIs: A Winning Combo for Reading Public Data</a></li>

This look like over-aggressive decluttering. In the HTML code, do the missing three links differ in any way from the others?

I didn’t turn de-cluttering on (in fact, it doesn’t even seem available for MD).

Not that I can see. Here’s a sample HTML excerpt with a link that gets clipped:

<p>The number <code>200</code> represents the 
<a href="">status code</a> 
returned by the request. A status code of <code>200</code> means that the request was successful. An unsuccessful request might show a status code of <code>404</code> if the URL doesn’t exist or <code>500</code> if there’s a server error when making the request.</p>

The only difference I can see is that the clipped links appear in the text, the omitted ones are the only content of li elements.

Also, why are these clipped links all clipped as references, not directly in the MD text but at the end?

Interesting questions. I’d need to dig into the code which is based on third-party code and modified by us.

It does not happen with all HTML documents, but it does with this one.

The declutterer removed the last paragraph because it only contains a list of links. We are now explicitly allowing <ul> and <ol>elements containing only links.

1 Like