Merge pull request #12607 from hiroshisuga/patch-35

Remove linefeed for polling option
This commit is contained in:
Anton Georgiev 2021-07-02 15:09:39 -04:00 committed by GitHub
commit 1b8fea89cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,14 +147,14 @@ const getPollResultString = (pollResultData, intl) => {
const matchYesNoPoll = (yesValue, noValue, contentString) => {
const ynPollString = `(${yesValue}\\s*\\/\\s*${noValue})|(${noValue}\\s*\\/\\s*${yesValue})`;
const ynOptionsRegex = new RegExp(ynPollString, 'gi');
const ynPoll = contentString.match(ynOptionsRegex) || [];
const ynPoll = contentString.replace(/\n/g,'').match(ynOptionsRegex) || [];
return ynPoll;
}
const matchYesNoAbstentionPoll = (yesValue, noValue, abstentionValue, contentString) => {
const ynaPollString = `(${yesValue}\\s*\\/\\s*${noValue}\\s*\\/\\s*${abstentionValue})|(${yesValue}\\s*\\/\\s*${abstentionValue}\\s*\\/\\s*${noValue})|(${abstentionValue}\\s*\\/\\s*${yesValue}\\s*\\/\\s*${noValue})|(${abstentionValue}\\s*\\/\\s*${noValue}\\s*\\/\\s*${yesValue})|(${noValue}\\s*\\/\\s*${yesValue}\\s*\\/\\s*${abstentionValue})|(${noValue}\\s*\\/\\s*${abstentionValue}\\s*\\/\\s*${yesValue})`;
const ynaOptionsRegex = new RegExp(ynaPollString, 'gi');
const ynaPoll = contentString.match(ynaOptionsRegex) || [];
const ynaPoll = contentString.replace(/\n/g,'').match(ynaOptionsRegex) || [];
return ynaPoll;
}