Page MenuHomePhabricator

Improve HTML tag insertable regex in MediaWiki insertable
Closed, ResolvedPublic

Description

Currently the HTML tag insertable regex in MediaWiki insertable has: /<\/?[a-z]+>/. This matches the tags only if they don't have an HTML attribute and highlight the starting tag and ending tags separately.

We can discuss and use an improve version that overcomes these limitations,

Possible regex: /(?<open><([a-z][a-z0-9]*)\b[^>]*>).*?(?<close><\/\2>)/

Event Timeline

abi_ triaged this task as Low priority.Feb 13 2020, 6:31 AM
abi_ updated the task description. (Show Details)

Change 713886 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MediaWikiInsertablesSuggester: Improve HTML insertable

https://gerrit.wikimedia.org/r/713886

Change 713886 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MediaWikiInsertablesSuggester: Improve HTML insertable

https://gerrit.wikimedia.org/r/713886