CodeblockCustomizer icon indicating copy to clipboard operation
CodeblockCustomizer copied to clipboard

Can't specify literal values for | or :

Open Truncated opened this issue 8 months ago • 7 comments

The parsing of the abc:xyz and | for constraining lines is nice. However I'm trying to highlight starting or ending on colons and pipes for regex and it doesn't appear that I can start or end on spaces, pipes, or colons as literal values.

Here's an example of one of the documentation lines I am trying to highlight to demonstrate how the reg-ex groups apply: {(workflow)(:name=.*??)(\\|.*??})

{workflow:name=any combo of characters until the first pipe...|after which any combo of characters until an end bracket...}

To highlight three parts of this: workflow :name=any combo of characters until the first pipe... |after which any combo of characters until an end bracket...}

Obviously, straight forward as-is you might want:

hl:workflow,::...,|:}

...of course, that didn't work at all... I tried a bunch of combinations which came up with some interesting results: image image image image image image These last few are interesting... having the pipe specified didn't break it when in the middle of the value, but the highlight doesn't start in the literal spot identified either...

Either being able to optionally wrap abc:xyz in quotes to be explicit a'la "abc":"xyz" or maybe implementing some way to escape the characters for literal use would be helpful.

With quotes, it might become: hl:"workflow",":":"...","|":"}"

As an imperfect workaround, when using the alternative colors (especially if they aren't transparent), the layering did allow me to fake it with: G1:workflow G2:w:... G5:.|:} image

Truncated avatar Jun 20 '24 03:06 Truncated