From 553f361a66457477e83406f1a1ba837e6cb7b4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20R=C3=B8er?= Date: Tue, 20 Sep 2022 06:57:00 +0200 Subject: [PATCH 1/2] Add support for underscore separator in numbers --- src/TextArea.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TextArea.js b/src/TextArea.js index ac6f565..523c2b3 100644 --- a/src/TextArea.js +++ b/src/TextArea.js @@ -68,6 +68,10 @@ export default function App() { const getResultFromInput = ({ input, parser }) => { try { + // Pre-parse input + // Used to ignore underscores in numbers to enable rust-like syntax + input = input.replace(/\b([\d_]+)/gi, (match) => (match.replace(/_/gi,''))); + const result = parser.evaluate(input); if (typeof result === 'number') { From 110841d563aa76b1b1a8497571796ef16f3d28ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20R=C3=B8er?= Date: Tue, 20 Sep 2022 07:28:12 +0200 Subject: [PATCH 2/2] Add noopener to a.rel property --- src/Banner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Banner.js b/src/Banner.js index 0b0832f..6c1856c 100644 --- a/src/Banner.js +++ b/src/Banner.js @@ -218,7 +218,7 @@ export default function Banner() {
GitHub