Topic on Extension talk:TextExtracts

Hide equal characters and headings

8
Summary by Thiemo Kreuz (WMDE)
Spiros71 (talkcontribs)

Using the Popups extension MW 1.31. Headings (level 2/3) are displayed with equal signs left and right. Is there a way not to show them?

Here is an image:

I tried adding this in TextExtracts\includes\ExtractFormatter.php but it did not seem to work.

$text = preg_replace( "={2,}(.*?)={2,}", "", $text );

Surrounding the headings (found on the template) with <div class="noexcerpt"> , did partially solve the problem but resulted in the mobile version (MinervaNeu) headings not being expandable/collapsible.

Thiemo Kreuz (WMDE) (talkcontribs)

Do you have a link to the actual page where this happens?

Spiros71 (talkcontribs)

I added the following in ExtractsRemoveClasses in TextExtracts\extension.json and it seemed to fix it.

"h2",

"h3",

Thiemo Kreuz (WMDE) (talkcontribs)

I would love to know more about your setup. See, every Wikipedia article starts with a level 2 headline. Why don't we have this issue, but you have it? What's the difference?

Utilizing the configuration is a nice idea. However, you should not edit extension.json but add $wgExtractsRemoveClasses[] = 'h2' ;$wgExtractsRemoveClasses[] = 'h3'; to your LocalSettings.php.

This post was hidden by Thiemo Kreuz (WMDE) (history)
Spiros71 (talkcontribs)

Thanks so much for the feedback. The difference may be that the level 2 headings are declared in the templates. Level 3 are in page text.


Here is the wiki http://lsj.gr/

Setup:

MediaWiki 1.31.12

PHP 7.3.25 (fpm-fcgi)

MariaDB 10.3.27-MariaDB-log

ICU 50.2

Elasticsearch 5.6.13


Extensions:

API, CirrusSearch, Cite, Data Transfer, Elastica, Extension, Gadgets, LabeledSectionTransclusion, Lockdown, MobileFrontend, Normalizer, Nuke, Other, Page Forms, PageImages, Parser hooks, ParserFunctions, ParserHooks, Popups, Replace Text, Semantic Drilldown, Semantic MediaWiki, Semantic Result Formats, Special pages, TextExtracts,

Thiemo Kreuz (WMDE) (talkcontribs)

The template is indeed the reason. Thanks a lot for the follow-up! I was now able to replay the issue locally. I created phab:T271439 to discuss possible fixes.

Spiros71 (talkcontribs)

Good job, Thiemo!

Reply to "Hide equal characters and headings"