ttcMD: fixes issues where paragraphs are filtered despite being a valid parent,

Fixes a greedy rx from inline-code
This commit is contained in:
2024-03-14 00:48:00 -06:00
parent 4615f11cfa
commit 9c04f13a42
3 changed files with 6 additions and 7 deletions

View File

@@ -185,7 +185,7 @@ TokenIdentifiers.set("anchor", {
},
});
TokenIdentifiers.set("inline-code", {
rx: /\s?`(.{3,}|[a-z0-9]*?)`[^`a-z0-9\n]/gi,
rx: /\s?`(.{3,}?|[a-z0-9]*?)`[^`a-z0-9\n]/gi,
parse(s) {
return {
// content: inline,

View File

@@ -123,9 +123,10 @@ function filterOverlappingPBlocks(blocks: TokenMarker[]): TokenMarker[] {
// Filter out 'p' blocks that overlap with any other block
for (const otherBlock of blocks) {
if (
otherBlock !== block && (
otherBlock !== block &&
(
otherBlock.start === block.start ||
otherBlock.end === block.end
(otherBlock.end === block.end && otherBlock.start < block.start)
)
) {
return false; // Overlapping 'p' block found, filter it out