mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 10:12:41 +00:00
A better regex for underlining.
This commit is contained in:
@@ -237,9 +237,9 @@ const superSubScripts = {
|
|||||||
const underline = {
|
const underline = {
|
||||||
name : 'underline',
|
name : 'underline',
|
||||||
level : 'inline',
|
level : 'inline',
|
||||||
start(src) { return src.match(/\w_[^_]_/m)?.index;},
|
start(src) { return src.match(/\b_(?![_\s])(.*?[^_\s])_\b/m)?.index;},
|
||||||
tokenizer(src, tokens) {
|
tokenizer(src, tokens) {
|
||||||
const uRegex = /^_([^_]*)_/m;
|
const uRegex = /^\b_(?![_\s])(.*?[^_\s])_\b/m;
|
||||||
const match = uRegex.exec(src);
|
const match = uRegex.exec(src);
|
||||||
console.log('Looking');
|
console.log('Looking');
|
||||||
if(match?.length) {
|
if(match?.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user