0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 20:33:51 +00:00

A better regex for underlining.

This commit is contained in:
David Bolack
2023-12-13 21:47:55 -06:00
parent 04187cf769
commit a88b256b6c

View File

@@ -237,9 +237,9 @@ const superSubScripts = {
const underline = {
name : 'underline',
level : 'inline',
start(src) { return src.match(/\w_[^_]_/m)?.index;},
start(src) { return src.match(/\b_(?![_\s])(.*?[^_\s])_\b/m)?.index;},
tokenizer(src, tokens) {
const uRegex = /^_([^_]*)_/m;
const uRegex = /^\b_(?![_\s])(.*?[^_\s])_\b/m;
const match = uRegex.exec(src);
console.log('Looking');
if(match?.length) {