Skip to content

Commit 12d8c6e

Browse files
committed
add regex and regex-syntax link
1 parent 3968e8b commit 12d8c6e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "wasm-pack test --node --chrome --headless"
7+
"test": "wasm-pack test --node --chrome --headless",
8+
"clear": "rm -rf dist/pkg dist/*.js dist/*.css dist/*.map",
9+
"build": "parcel build --public-url rust-regex-playground/ index.html pkg/index_bg.wasm"
810
},
911
"repository": {
1012
"type": "git",

playground/App.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export default function App({ store }: IAppProps) {
105105
const completed = !!(store.value.features && store.value.features.completed);
106106
const rregex = !!(store.value.features && store.value.features.rregex);
107107
const rregexError = store.value.features && store.value.features.rregexError;
108+
const versions = store.value.versions || {};
108109

109110
return (
110111
<Pane display="flex">
@@ -126,7 +127,10 @@ export default function App({ store }: IAppProps) {
126127
<Button
127128
is="a"
128129
target="_blank"
129-
href="#"
130+
href={
131+
"https://docs.rs/regex" +
132+
(versions.regex ? versions.regex + "/regex/" : "")
133+
}
130134
appearance="minimal"
131135
height={32}
132136
iconAfter="book"
@@ -137,7 +141,12 @@ export default function App({ store }: IAppProps) {
137141
<Button
138142
is="a"
139143
target="_blank"
140-
href="#"
144+
href={
145+
"https://docs.rs/regex-syntax" +
146+
(versions.regex_syntax
147+
? versions.regex_syntax + "/regex_syntax/"
148+
: "")
149+
}
141150
appearance="minimal"
142151
height={32}
143152
iconAfter="book"

0 commit comments

Comments
 (0)