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

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

Conversation

sunafterrainwm
Copy link
Contributor

No description provided.

modules/twinklecopyvio.js Outdated Show resolved Hide resolved
@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
Copy link
Member

Xi-Plus commented May 10, 2021

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

@@ -114,7 +114,7 @@ Twinkle.copyvio.callbacks = {
},
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
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
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