refactor: Use ===
This commit is contained in:
@@ -31,7 +31,7 @@ export const mfmLanguage = P.createLanguage({
|
||||
r.center,
|
||||
),
|
||||
startOfLine: () => P((input, i) => {
|
||||
if (i == 0 || input[i] == '\n' || input[i - 1] == '\n') {
|
||||
if (i === 0 || input[i] === '\n' || input[i - 1] === '\n') {
|
||||
return P.makeSuccess(i, null);
|
||||
} else {
|
||||
return P.makeFailure(i, 'not newline');
|
||||
@@ -50,7 +50,7 @@ export const mfmLanguage = P.createLanguage({
|
||||
if (!text.match(/^>[\s\S]+?/)) return P.makeFailure(i, 'not a quote');
|
||||
const quote = takeWhile(line => line.startsWith('>'), text.split('\n'));
|
||||
const qInner = quote.join('\n').replace(/^>/gm, '').replace(/^ /gm, '');
|
||||
if (qInner == '') return P.makeFailure(i, 'not a quote');
|
||||
if (qInner === '') return P.makeFailure(i, 'not a quote');
|
||||
const contents = r.root.tryParse(qInner);
|
||||
return P.makeSuccess(i + quote.join('\n').length + 1, createTree('quote', contents, {}));
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user