Updated parseTitle to remove escape characters
Tests pass, however the JS running in the browser appears to be behaving differently. Not got to the bottom of it yet
This commit is contained in:
@ -6,7 +6,10 @@ export default function parseTitle(text: string = '') {
|
||||
|
||||
// find and extract title
|
||||
const firstLine = text.trim().split(/\r?\n/)[0];
|
||||
const title = firstLine.replace(/^#/, '').trim();
|
||||
const trimmedTitle = firstLine.replace(/^#/, '').trim();
|
||||
|
||||
// remove any escape characters
|
||||
const title = trimmedTitle.replace(/\\([\\`*{}[\]()#+\-.!_>])/g, '$&');
|
||||
|
||||
// find and extract first emoji
|
||||
const matches = regex.exec(title);
|
||||
|
Reference in New Issue
Block a user