Skip to content

copyvio: Add copyvio-templates on non-wikitext pages [feature]#207

Closed
sunafterrainwm wants to merge 5 commits into
xiplus-mediawiki-programs:masterfrom
sunafterrainwm:feature-copyvio-templates-non-wikitext-pages
Closed

copyvio: Add copyvio-templates on non-wikitext pages [feature]#207
sunafterrainwm wants to merge 5 commits into
xiplus-mediawiki-programs:masterfrom
sunafterrainwm:feature-copyvio-templates-non-wikitext-pages

Conversation

@sunafterrainwm

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread modules/twinklecopyvio.js Outdated
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label May 9, 2021
@sunafterrainwm sunafterrainwm force-pushed the feature-copyvio-templates-non-wikitext-pages branch from 981903b to 85e2a76 Compare May 9, 2021 14:20
@github-actions github-actions Bot removed the dependencies Pull requests that update a dependency file label May 9, 2021
@Xi-Plus

Xi-Plus commented May 10, 2021

Copy link
Copy Markdown
Member

json不也需要parse嗎?不過我個人覺得parse的作法有點醜陋,把上面的subst改成safesubst就能適度的顯示模板了(只有簽名不會展開,但應可忽略)

Comment thread modules/twinklecopyvio.js
taggingArticle: function(pageobj) {
var params = pageobj.getCallbackParameters();
var tag = '{{subst:Copyvio/auto|url=' + params.source.replace(/http/g, 'http').replace(/\n+/g, '\n').replace(/^\s*([^*])/gm, '* $1').replace(/^\* $/m, '') + '|OldRevision=' + mw.config.get('wgRevisionId') + '}}';
var tag = '{{safeubst:Copyvio/auto|url=' + params.source.replace(/http/g, 'http').replace(/\n+/g, '\n').replace(/^\s*([^*])/gm, '* $1').replace(/^\* $/m, '') + '|OldRevision=' + mw.config.get('wgRevisionId') + '}}';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safesubst

@sunafterrainwm

Copy link
Copy Markdown
Contributor Author

等待 #215 完成

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.

3 participants