mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-22 12:53:35 +00:00
f1edc47050
Since92f5cfd8
we support "mw-notalk" to suppressing comment detection in pages or sections. Until now, it only worked when the comment timestamp was surrounded by a marked element. However, when a marked element was directly adjacent to a comment, it would sometimes become a part of the comment range. This can no longer happen now. Existing use cases for this were the {{outdent}} and {{tracked}} templates, which we handle specially since50ad5bb2
andddd391b6
. It's a bit ugly to hardcode specific templates like that, and this provides a better solution for the future. The added test case displays some other potential uses. Bug: T324132 Change-Id: I7ffd299ef5957b35da8d01f9a0ed5a7a9a78be83
302 lines
6.3 KiB
JSON
302 lines
6.3 KiB
JSON
[
|
|
{
|
|
"placeholderHeading": false,
|
|
"type": "heading",
|
|
"range": [
|
|
"1/0/0",
|
|
"1/0/1"
|
|
],
|
|
"headingLevel": 2,
|
|
"level": 0,
|
|
"name": "h-",
|
|
"id": "h-No_talk_section",
|
|
"warnings": [],
|
|
"replies": []
|
|
},
|
|
{
|
|
"placeholderHeading": false,
|
|
"type": "heading",
|
|
"range": [
|
|
"5/1/0/0",
|
|
"5/1/0/1"
|
|
],
|
|
"headingLevel": 2,
|
|
"level": 0,
|
|
"name": "h-DTDummyUserAlice-2022-03-10T14:30:00.000Z",
|
|
"id": "h-Archived_section-2022-03-10T14:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T14:30:00.000Z",
|
|
"author": "DTDummyUserAlice",
|
|
"range": [
|
|
"5/3/0",
|
|
"5/3/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"5/3/1",
|
|
"5/3/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"5/3/4/2",
|
|
"5/3/4/28"
|
|
]
|
|
],
|
|
"level": 1,
|
|
"name": "c-DTDummyUserAlice-2022-03-10T14:30:00.000Z",
|
|
"id": "c-DTDummyUserAlice-2022-03-10T14:30:00.000Z-Archived_section",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T14:40:00.000Z",
|
|
"author": "DTDummyUserBob",
|
|
"range": [
|
|
"5/5/0/0",
|
|
"5/5/0/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"5/5/0/1",
|
|
"5/5/0/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"5/5/0/4/2",
|
|
"5/5/0/4/28"
|
|
]
|
|
],
|
|
"level": 2,
|
|
"name": "c-DTDummyUserBob-2022-03-10T14:40:00.000Z",
|
|
"id": "c-DTDummyUserBob-2022-03-10T14:40:00.000Z-DTDummyUserAlice-2022-03-10T14:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T14:50:00.000Z",
|
|
"author": "DTDummyUserEve",
|
|
"range": [
|
|
"5/5/0/5/0/0",
|
|
"5/5/0/5/0/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"5/5/0/5/0/1",
|
|
"5/5/0/5/0/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"5/5/0/5/0/4/2",
|
|
"5/5/0/5/0/4/28"
|
|
]
|
|
],
|
|
"level": 3,
|
|
"name": "c-DTDummyUserEve-2022-03-10T14:50:00.000Z",
|
|
"id": "c-DTDummyUserEve-2022-03-10T14:50:00.000Z-DTDummyUserBob-2022-03-10T14:40:00.000Z",
|
|
"warnings": [],
|
|
"replies": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"placeholderHeading": false,
|
|
"type": "heading",
|
|
"range": [
|
|
"7/0/0",
|
|
"7/0/1"
|
|
],
|
|
"headingLevel": 2,
|
|
"level": 0,
|
|
"name": "h-DTDummyUserAlice-2022-03-10T15:30:00.000Z",
|
|
"id": "h-Normal_talk_section-2022-03-10T15:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T15:30:00.000Z",
|
|
"author": "DTDummyUserAlice",
|
|
"range": [
|
|
"9/0",
|
|
"9/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"9/1",
|
|
"9/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"9/4/2",
|
|
"9/4/28"
|
|
]
|
|
],
|
|
"level": 1,
|
|
"name": "c-DTDummyUserAlice-2022-03-10T15:30:00.000Z",
|
|
"id": "c-DTDummyUserAlice-2022-03-10T15:30:00.000Z-Normal_talk_section",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T15:40:00.000Z",
|
|
"author": "DTDummyUserBob",
|
|
"range": [
|
|
"11/0/0",
|
|
"11/0/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"11/0/1",
|
|
"11/0/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"11/0/4/2",
|
|
"11/0/4/28"
|
|
]
|
|
],
|
|
"level": 2,
|
|
"name": "c-DTDummyUserBob-2022-03-10T15:40:00.000Z",
|
|
"id": "c-DTDummyUserBob-2022-03-10T15:40:00.000Z-DTDummyUserAlice-2022-03-10T15:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T15:50:00.000Z",
|
|
"author": "DTDummyUserEve",
|
|
"range": [
|
|
"11/0/5/0/0",
|
|
"11/0/5/0/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"11/0/5/0/1",
|
|
"11/0/5/0/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"11/0/5/0/4/2",
|
|
"11/0/5/0/4/28"
|
|
]
|
|
],
|
|
"level": 3,
|
|
"name": "c-DTDummyUserEve-2022-03-10T15:50:00.000Z",
|
|
"id": "c-DTDummyUserEve-2022-03-10T15:50:00.000Z-DTDummyUserBob-2022-03-10T15:40:00.000Z",
|
|
"warnings": [],
|
|
"replies": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"placeholderHeading": false,
|
|
"type": "heading",
|
|
"range": [
|
|
"13/0/0",
|
|
"13/0/1"
|
|
],
|
|
"headingLevel": 2,
|
|
"level": 0,
|
|
"name": "h-DTDummyUserAlice-2022-03-10T16:30:00.000Z",
|
|
"id": "h-Talk_section_with_notalk_fragments-2022-03-10T16:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T16:30:00.000Z",
|
|
"author": "DTDummyUserAlice",
|
|
"range": [
|
|
"17/0",
|
|
"17/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"17/1",
|
|
"17/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"17/4/2",
|
|
"17/4/28"
|
|
]
|
|
],
|
|
"level": 1,
|
|
"name": "c-DTDummyUserAlice-2022-03-10T16:30:00.000Z",
|
|
"id": "c-DTDummyUserAlice-2022-03-10T16:30:00.000Z-Talk_section_with_notalk_fragments",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T16:40:00.000Z",
|
|
"author": "DTDummyUserBob",
|
|
"range": [
|
|
"21/0/1",
|
|
"21/0/5/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"21/0/2",
|
|
"21/0/5/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"21/0/5/2",
|
|
"21/0/5/28"
|
|
]
|
|
],
|
|
"level": 2,
|
|
"name": "c-DTDummyUserBob-2022-03-10T16:40:00.000Z",
|
|
"id": "c-DTDummyUserBob-2022-03-10T16:40:00.000Z-DTDummyUserAlice-2022-03-10T16:30:00.000Z",
|
|
"warnings": [],
|
|
"replies": [
|
|
{
|
|
"type": "comment",
|
|
"timestamp": "2022-03-10T16:50:00.000Z",
|
|
"author": "DTDummyUserEve",
|
|
"range": [
|
|
"25/0/0/0/0",
|
|
"25/0/0/0/4/28"
|
|
],
|
|
"signatureRanges": [
|
|
[
|
|
"25/0/0/0/1",
|
|
"25/0/0/0/4/28"
|
|
]
|
|
],
|
|
"timestampRanges": [
|
|
[
|
|
"25/0/0/0/4/2",
|
|
"25/0/0/0/4/28"
|
|
]
|
|
],
|
|
"level": 3,
|
|
"name": "c-DTDummyUserEve-2022-03-10T16:50:00.000Z",
|
|
"id": "c-DTDummyUserEve-2022-03-10T16:50:00.000Z-DTDummyUserBob-2022-03-10T16:40:00.000Z",
|
|
"warnings": [],
|
|
"replies": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|