Comment

Comment by penteract

Here's a tested version that, given text containing only lower case letters, backslash and double quote, capitalizes the letters between quotes and handles escaping reasonably. (works with NotoSans-Regular.ttf)

    @Char = [a-z quotedbl backslash];
    @CharQuoted = [A-Z quotesingle slash];
    @NonQuoteQuoted = [A-Z slash];
    @Escaped = [asterisk dollar];
    
    feature liga {
      lookup xa {
        sub quotedbl @Char' by @CharQuoted;
        sub slash backslash' by dollar; 
        sub slash quotedbl' by asterisk;
        sub [@NonQuoteQuoted asterisk dollar] @Char' by @CharQuoted;
      } xa;
    } liga;
    feature liga {
      lookup xb {
        sub quotesingle' by quotedbl;
        sub slash' by backslash;
        sub dollar' by  backslash;
        sub asterisk' by quotedbl;
      } xb;
    } liga;
parent penteract 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton