Handle no match cases and modify textForEvent to handle redacted messages
This commit is contained in:
parent
c58abd9582
commit
8a1cd77ef4
2 changed files with 13 additions and 9 deletions
|
@ -35,12 +35,13 @@ export default class PlainTextExporter extends Exporter {
|
|||
|
||||
const match = REPLY_REGEX.exec(content.body);
|
||||
|
||||
if (!match) return content.body;
|
||||
|
||||
let rplSource: string;
|
||||
const rplName = match[1];
|
||||
const rplText = match[3];
|
||||
const sourceMatch = REPLY_REGEX.exec(content.body);
|
||||
rplSource = sourceMatch && sourceMatch.length === 4 ? sourceMatch[3] : content.body;
|
||||
rplSource = rplSource.substring(0, REPLY_SOURCE_MAX_LENGTH);
|
||||
|
||||
rplSource = match[2].substring(1, REPLY_SOURCE_MAX_LENGTH);
|
||||
// Get the first non-blank line from the source.
|
||||
const lines = rplSource.split('\n').filter((line) => !/^\s*$/.test(line))
|
||||
if (lines.length > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue