mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 02:11:38 +03:00
tokenizeMessage: fix URLs inside inline codeblocks
Fixes urbit/landscape#699
This commit is contained in:
parent
eedef4ea1a
commit
edf6456d6c
@ -58,13 +58,7 @@ const tokenizeMessage = (text) => {
|
||||
|| (str === '`' && !isInCodeBlock)
|
||||
) {
|
||||
isInCodeBlock = true;
|
||||
} else if (
|
||||
(str.endsWith('`') && str !== '`')
|
||||
|| (str === '`' && isInCodeBlock)
|
||||
) {
|
||||
isInCodeBlock = false;
|
||||
}
|
||||
|
||||
if(isRef(str) && !isInCodeBlock) {
|
||||
if (currTextLine.length > 0 || currTextBlock.length > 0) {
|
||||
// If we're in the middle of a message, add it to the stack and reset
|
||||
@ -105,6 +99,13 @@ const tokenizeMessage = (text) => {
|
||||
} else {
|
||||
currTextLine.push(str);
|
||||
}
|
||||
if (
|
||||
(str.endsWith('`') && str !== '`')
|
||||
|| (str === '`' && isInCodeBlock)
|
||||
) {
|
||||
isInCodeBlock = false;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
currTextBlock.push(currTextLine.join(' '))
|
||||
|
Loading…
Reference in New Issue
Block a user