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

tag: add namespace rules for redirect tags #1467

Conversation

NovemLinguae
Copy link
Member

@NovemLinguae NovemLinguae commented Nov 20, 2021

Fixes #1459 Fix redirect category namespace detection

I found 184 {{R to/from X}} style redirect tags that are namespace-specific. This PR codes Twinkle to not display these unless it is the correct namespace.

I copy/pasted a utility function from Stack Overflow, and used a comment with a URL as attribution.

Here's a couple test cases to check:

			var insideMainspaceOnly = [
				'R from acronym',
			];
			var insideTalkNamespaceOnly = [
				'R from remote talk page'
			];
			var disambiguationPagesOnly = [
				'R to disambiguation page'
			];
			var outsideUserspaceOnly = [
				'R to user namespace'
			];

2021-11-23_024334

modules/friendlytag.js Outdated Show resolved Hide resolved
modules/friendlytag.js Outdated Show resolved Hide resolved
modules/friendlytag.js Outdated Show resolved Hide resolved
@NovemLinguae
Copy link
Member Author

@siddharthvp Is this patch OK to merge despite not agreeing with the 2 code review comments? Are your concerns sufficiently addressed?

@NovemLinguae
Copy link
Member Author

@siddharthvp After I fix the merge conflict, is this patch OK to merge despite not agreeing with the 2 code review comments? Are your concerns sufficiently addressed?

@siddharthvp
Copy link
Member

@NovemLinguae Yeah go ahead. Sorry about the delayed response. Didn't realise this has been sitting for more than a year. How time flies.

modules/friendlytag.js Outdated Show resolved Hide resolved
@NovemLinguae NovemLinguae force-pushed the namespace-rules-for-redirect-tags2 branch from f4622cc to 95cb152 Compare July 19, 2023 19:32
@NovemLinguae NovemLinguae merged commit d9520e8 into wikimedia-gadgets:master Jul 19, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix redirect category namespace detection
2 participants