Visitar URL original
"comment" in unlikely candidates mutilates formatted code blocks · Issue #182 · buriy/python-readability · GitHub
Skip to content

"comment" in unlikely candidates mutilates formatted code blocks #182

Description

@abeyerpath

I've seen several cases of code blocks using color schemes where "comment" becomes a style and starts getting trimmed. At best this loses all the comments, and may further mutilate the structure.

I wonder if the unlikely candidates trimming should ignore elements inside of pre/code blocks?

Activity

  1. buriy commented on Apr 12, 2024

    @buriy
    Owner

    Then it wouldn't cut ads and different "related" blocks that didn't get below the cut threshold.
    Could you please provide an (or several) example page(s)?

  2. buriy commented on Aug 26, 2026

    @buriy
    Owner

    Fixed in 0.9. Code and preformatted blocks are protected from unlikely-candidate filtering even when class names contain terms such as comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions