mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-18 11:02:57 +00:00
80e52e1155
* Remove the existing approach for detecting signatures that only worked in source mode; remove autoSignWikitext() * Use the same approach for auto-signing in source mode as we have already used in visual * In both modes, detect whether the user has already typed a signature at the end of their comment in the modifier, and if so, don't add a signature * Add test cases for the detection Bug: T255738 Change-Id: I791d3035cb1ffc33ce3966d4617a25d08700c35b
53 lines
969 B
JSON
53 lines
969 B
JSON
[
|
|
{
|
|
"msg": "Simple message",
|
|
"wikitext": "Foo bar",
|
|
"expected": false
|
|
},
|
|
{
|
|
"msg": "Already signed",
|
|
"wikitext": "Foo bar ~~~~",
|
|
"expected": true
|
|
},
|
|
{
|
|
"msg": "Already signed with trailing whitespace",
|
|
"wikitext": "Foo bar ~~~~ \n",
|
|
"expected": true
|
|
},
|
|
{
|
|
"msg": "Already signed (not at the end)",
|
|
"wikitext": "(Foo bar ~~~~)",
|
|
"expected": false
|
|
},
|
|
{
|
|
"msg": "Not signed, literal tildes",
|
|
"wikitext": "Hello, I'm <nowiki>~~~~</nowiki>",
|
|
"expected": false
|
|
},
|
|
{
|
|
"msg": "Already signed multi-line",
|
|
"wikitext": "Foo\n\nbar\n\n~~~~",
|
|
"expected": true
|
|
},
|
|
{
|
|
"msg": "Already signed with hyphens",
|
|
"wikitext": "Foo bar --~~~~",
|
|
"expected": true
|
|
},
|
|
{
|
|
"msg": "Already signed without space",
|
|
"wikitext": "Foo bar~~~~",
|
|
"expected": true
|
|
},
|
|
{
|
|
"msg": "Signed with 5 tildes",
|
|
"wikitext": "Foo bar ~~~~~",
|
|
"expected": false
|
|
},
|
|
{
|
|
"msg": "Signed with 3 tildes",
|
|
"wikitext": "Foo bar ~~~",
|
|
"expected": false
|
|
}
|
|
]
|