From 25a13acb7a84aa14e845c2c08dc25a920764bc3e Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 27 Apr 2021 11:59:21 -0400 Subject: [PATCH] docs: finish for now and clean up readme --- www/src/components/Layout.tsx | 4 ++-- www/src/pages/index.tsx | 3 +-- www/tailwind.config.js | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/www/src/components/Layout.tsx b/www/src/components/Layout.tsx index fc170c06..46f582ec 100644 --- a/www/src/components/Layout.tsx +++ b/www/src/components/Layout.tsx @@ -1,7 +1,7 @@ import { MDXProvider } from '@mdx-js/react'; import styled, { css } from 'astroturf/react'; -import React, { useState } from 'react'; import { Link } from 'gatsby'; +import React, { useState } from 'react'; import CodeBlock from './CodeBlock'; @@ -56,7 +56,7 @@ function Layout(props: Props) { }} >
{ + // Capture as liberally as possible, including things like `h-(screen-1.5)` + const broadMatches = content.match(/[^<>"'`\s]*[^,<>"'`\s:]/g) || []; + const broadMatchesWithoutTrailingSlash = broadMatches.map((match) => + match.replace(/\\\\$/, ''), + ); + + // Capture classes within other delimiters like .block(class="w-1/2") in Pug + const innerMatches = + content.match(/[^<>"'`\s.(){}[\]#=%]*[^<>"'`\s.(){}[\]#=%:]/g) || []; + + return broadMatches + .concat(broadMatchesWithoutTrailingSlash) + .concat(innerMatches); + }, + }, + }, theme: { fontFamily: { brand: 'Fontdiner Swanky',