diff --git a/package.json b/package.json index 72744dc7..8f1ba77a 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-import": "2.25.3", "prettier": "^2.5.1", + "prettier-plugin-tailwindcss": "^0.1.4", "typescript": "^4.5.5", "webpack": "^5.67.0" } diff --git a/remark/prism-diff-highlight.js b/remark/prism-diff-highlight.js index 31bdf229..344a808f 100644 --- a/remark/prism-diff-highlight.js +++ b/remark/prism-diff-highlight.js @@ -1,7 +1,8 @@ // https://github.com/PrismJS/prism/blob/master/plugins/diff-highlight/prism-diff-highlight.js module.exports = (Prism) => { var LANGUAGE_REGEX = /diff-([\w-]+)/i - var HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi + var HTML_TAG = + /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi //this will match a line plus the line break while ignoring the line breaks HTML tags may contain. var HTML_LINE = RegExp( /(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))/.source.replace(/__/g, function () { diff --git a/remark/utils.js b/remark/utils.js index 5183fd96..5eff169e 100644 --- a/remark/utils.js +++ b/remark/utils.js @@ -3,7 +3,8 @@ const loadLanguages = require('prismjs/components/') loadLanguages() require('./prism-diff-highlight')(Prism) -const HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi +const HTML_TAG = + /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi const PSEUDO_CLASSES = [ 'active', 'any-link', diff --git a/remark/withSyntaxHighlighting.js b/remark/withSyntaxHighlighting.js index 9394e3d7..083537ac 100644 --- a/remark/withSyntaxHighlighting.js +++ b/remark/withSyntaxHighlighting.js @@ -17,7 +17,9 @@ module.exports.withSyntaxHighlighting = () => { if (node.lang !== null) { node.type = 'html' node.value = [ - `
`, + `
`, `
`,
diff --git a/src/components/Button.js b/src/components/Button.js
index ff9dec8e..7291fcda 100644
--- a/src/components/Button.js
+++ b/src/components/Button.js
@@ -3,7 +3,7 @@ import Link from 'next/link'
 export function Button({ children, ...props }) {
   return (
     
-      
+      
         {children}
         
           
diff --git a/src/components/ClassTable.js b/src/components/ClassTable.js
index ec2cba86..60de514c 100644
--- a/src/components/ClassTable.js
+++ b/src/components/ClassTable.js
@@ -126,40 +126,40 @@ export const ClassTable = memo(
     })
 
     return (
-      
+
Default class reference
12 } )} > {custom || ( - +
- {preview && ( - @@ -176,7 +176,7 @@ export const ClassTable = memo(
-
Class
+
+
Class
Properties
-
+
+
Preview 
{stringifyProperties(transformProperties({ selector, properties }), { filter: filterProperties, diff --git a/src/components/CodeSample.js b/src/components/CodeSample.js index 7cda6db0..ae280dd4 100644 --- a/src/components/CodeSample.js +++ b/src/components/CodeSample.js @@ -73,7 +73,7 @@ function Snippet({ color, snippet }) { >
+    
{preview ? (