mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-25 03:12:40 +00:00
Add subscript and subscript markdown tokens
Uses ^^ for superscript and ^^^ subscript as wrappers in the same pattern as italics and bold ( * and **, respectively) Adds editor hot-keys and sytax highlighting. (CTRL-6/CTRL-7) Exact values may not be ideal. Short of the suggestted overloading of ~, I didn't see a better option for the delimiter.
This commit is contained in:
@@ -211,8 +211,8 @@ const superSubScripts = {
|
||||
level : 'inline',
|
||||
start(src) { return src.match(/.*\^\^(.+)\^\^/)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
tokenizer(src, tokens) {
|
||||
const superRegex = /.*\^\^(.+)\^\^/y;
|
||||
const subRegex = /.*\^\^\^(.+)\^\^\^/y;
|
||||
const superRegex = /\^\^(.+)\^\^/y;
|
||||
const subRegex = /\^\^\^(.+)\^\^\^/y;
|
||||
let isSuper = false;
|
||||
let match = subRegex.exec(src);
|
||||
if(!match){
|
||||
@@ -220,10 +220,7 @@ const superSubScripts = {
|
||||
if(match) {
|
||||
isSuper = true;
|
||||
}
|
||||
} else {
|
||||
console.log(src);
|
||||
}
|
||||
|
||||
if(match?.length) {
|
||||
const tags = this.lexer.inlineTokens(match[1]);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user