You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text and regex selectors don't match smart quotes #3693
Selectors "\"", "“", "”", regex("[\"“”]") look like they would match quotes. However, since smart quotes are not parsed as text, they can not match smart quotes.
Just adding to this, another example is regex("\.\.\."), which seems as if it should match ellipsis, but it doesn't. regex("\.\.") works perfectly.
I know this isn't what this is intended for, but when I came across show rules and regex selectors I got really excited, as this effectively lets me define my own custom syntax, i.e. like @ for refs. In this context, regex selectors should really operate on the raw input text, not on a processed version. To me this would be brilliant as different people (and different documents) require certain functions a lot. Being able to define my own shorthand in this way seems great. I know it wouldn't be terribly reliable, but that really doesn't matter. If 5% of the time I have to use the full function syntax, that's not a problem.
Just to add to my previous comment, while I still think it's unintuitive that this regex doesn't work, I have since discovered the incredible power of show: commands, without any filters. Ultimately one can bypass any other limitation by manually processing the whole document. Again, blown away by how configurable and fun Typst is!
Activity
Enivex commentedon Mar 16, 2024
Related #86
Text show rules are pretty brittle in general.
davystrong commentedon Aug 9, 2024
Just adding to this, another example is
regex("\.\.\."), which seems as if it should match ellipsis, but it doesn't.regex("\.\.")works perfectly.I know this isn't what this is intended for, but when I came across show rules and regex selectors I got really excited, as this effectively lets me define my own custom syntax, i.e. like @ for refs. In this context, regex selectors should really operate on the raw input text, not on a processed version. To me this would be brilliant as different people (and different documents) require certain functions a lot. Being able to define my own shorthand in this way seems great. I know it wouldn't be terribly reliable, but that really doesn't matter. If 5% of the time I have to use the full function syntax, that's not a problem.
davystrong commentedon Aug 9, 2024
Just to add to my previous comment, while I still think it's unintuitive that this regex doesn't work, I have since discovered the incredible power of
show:commands, without any filters. Ultimately one can bypass any other limitation by manually processing the whole document. Again, blown away by how configurable and fun Typst is!