File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ export default class ContributionSurveyRowParser {
9595 private current : string ;
9696
9797 /**
98- *
9998 * @param wikitext
10099 */
101100 constructor ( readonly wikitext : string ) {
@@ -138,7 +137,7 @@ export default class ContributionSurveyRowParser {
138137 const revids : number [ ] = [ ] ;
139138 const revidText : Record < number , string > = { } ;
140139 let diffs : string = null ,
141- comments : string ,
140+ comments : string | null ,
142141 diffTemplate = '[[Special:Diff/$1|($2)]]' ;
143142 if ( extras ) {
144143 const starting = this . current ;
@@ -200,6 +199,11 @@ export default class ContributionSurveyRowParser {
200199 comments = this . getCurrentLength ( ) > 0 ? this . eatRemaining ( ) : null ;
201200 }
202201
202+ if ( comments ?. trim ( ) ?. length === 0 ) {
203+ // Comments are just spaces. Let's just drop comments altogether.
204+ comments = null ;
205+ }
206+
203207 // "{bullet}{creation}[[{page}]]{extras}{diffs}{comments}"
204208 return {
205209 type : ( extras || comments || diffs ) == null ? 'pageonly' : 'detailed' ,
You can’t perform that action at this time.
0 commit comments