mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
34 lines
606 B
TypeScript
34 lines
606 B
TypeScript
import Prism from "prismjs"
|
|
|
|
if (supportsLookBehind()) {
|
|
Prism.languages.env = {
|
|
property: {
|
|
pattern: /(.*.)(?==)/,
|
|
},
|
|
string: {
|
|
pattern: /(?<==)(.*.)/g,
|
|
global: true,
|
|
},
|
|
operator: {
|
|
pattern: /=/
|
|
}
|
|
}
|
|
} else {
|
|
Prism.languages.env = {
|
|
property: {
|
|
pattern: /(.*.)(?==)/,
|
|
},
|
|
operator: {
|
|
pattern: /=/
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function supportsLookBehind() {
|
|
try {
|
|
return /(?<==)(.*)/.test("=hello")
|
|
} catch(e) {
|
|
return false;
|
|
}
|
|
} |