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

wikipedia: Message boxes are included in snippet #2158

Closed
dgw opened this issue Jul 14, 2021 · 0 comments · Fixed by #2159
Closed

wikipedia: Message boxes are included in snippet #2158

dgw opened this issue Jul 14, 2021 · 0 comments · Fixed by #2159
Labels
Bug Things to squish; generally used for issues
Milestone

Comments

@dgw
Copy link
Member

dgw commented Jul 14, 2021

As of this writing, the issue is easily reproduced by sending a link to https://en.wikipedia.org/wiki/Gurmukhi#Letters in a channel where Sopel and the wikipedia plugin will see it:

<Sopel> [wikipedia] Gurmukhi - Letters | "This article contains IPA phonetic symbols. Without proper rendering
        support, you may see question marks, boxes, or other symbols instead of Unicode characters. For an
        introductory guide on IPA symbols, see Help:IPA. The Gurmukhī alphabet contains thirty-five base letters
        (akkhara, plural akkharā̃), traditionally arranged in seven rows of five letters each. The first three
        letters, or mātarā vāhak ("vowel […]"

The leading text there ("This article contains IPA" through "see Help:IPA.") comes from a message box template. Wikipedia (the English version, at least) has many such templates for IPA, various non-Roman scripts, and numerous categories of "issues" with articles such as insufficient sources. They're good for informing users about potential problems with rendering, or pointing out ways that the reader could help improve the page if they have the required knowledge. However, it's not useful to output them as part of the page snippet on IRC.

Preliminary research indicates that they generally use the Message box Lua module as a template base, and therefore filtering out <table>s with one of these seven class names (modified quote from a snippet of Mbox docs) should skip most of them:

  • ambox, for messageboxes on article pages.
  • cmbox, for messageboxes on category pages.
  • imbox, for messageboxes on file (image) pages.
  • tmbox, for messageboxes on talk pages.
  • fmbox, for header and footer messageboxes.
  • ombox, for messageboxes on other types of page.
  • mbox, for messageboxes that are used in different namespaces and change their presentation accordingly.

The plugin's parser logic already provides for skipping over irrelevant content; it shouldn't be too painful to add these boxes.

@dgw dgw added the Bug Things to squish; generally used for issues label Jul 14, 2021
@dgw dgw added this to the 7.1.3 milestone Jul 14, 2021
@dgw dgw closed this as completed in #2159 Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Things to squish; generally used for issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant