Skip to content

Commit

Permalink
morebits: Unbind <nowiki> when replacing pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
atlight committed Jan 16, 2016
1 parent 554664b commit 8400a0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion morebits.js
Expand Up @@ -1043,7 +1043,11 @@ Morebits.string = {
},
// for deletion/other templates taking a freeform "reason" from a textarea (e.g. PROD, XFD, RPP)
formatReasonText: function( str ) {
return str.toString().trimRight().replace(/\|/g, "{{subst:!}}");
var result = str.toString().trimRight();
var unbinder = new Morebits.unbinder(result);
unbinder.unbind("<nowiki>", "</nowiki>");

This comment has been minimized.

Copy link
@MusikAnimal

MusikAnimal Jan 18, 2016

Collaborator

@atlight This apparently breaks the outer <nowiki>...</nowiki>. When I went to update on-wiki the ~~~~ on line 2865 was transformed to my signature. Not sure how the unbinder works but maybe we could escape the < and >'s?

unbinder.content = unbinder.content.replace(/\|/g, "{{subst:!}}");
return unbinder.rebind();
}
};

Expand Down

3 comments on commit 8400a0b

@atlight
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which outer <nowiki>? This function should only be used on the reason itself, if it's being used on anything else, it's incorrect.

@atlight
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, OK.... on the gadget itself!! Right. I hadn't thought of that. We could just do '<no' + 'wiki> or something?

@MusikAnimal
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes that should work, I will try that. Thanks!

Please sign in to comment.