| | |
| | | // \[\[ -> open brace |
| | | // ([^\[\]\|\#]+) -> one or more non-special characters ([,],|, or #) (name) |
| | | // (#[^\[\]\|\#]+)? -> # then one or more non-special characters (heading link) |
| | | // (\\?\|[^\[\]\#]+)? -> optional escape \ then | then one or more non-special characters (alias) |
| | | // (\\?\|[^\[\]\#]+)? -> optional escape \ then | then zero or more non-special characters (alias) |
| | | export const wikilinkRegex = new RegExp( |
| | | /!?\[\[([^\[\]\|\#\\]+)?(#+[^\[\]\|\#\\]+)?(\\?\|[^\[\]\#]+)?\]\]/g, |
| | | /!?\[\[([^\[\]\|\#\\]+)?(#+[^\[\]\|\#\\]+)?(\\?\|[^\[\]\#]*)?\]\]/g, |
| | | ) |
| | | |
| | | // ^\|([^\n])+\|\n(\|) -> matches the header row |