You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removing this from the code since it was commented out and unused at the moment, but would be great to add back in shortly. Whenever we want to add custom syntax token styles we can use regex to identify and add it to the Prism rules. Placing code here for reference.
// Add Prism JS
const script = document.createElement('script');
script.src = "./universe-editor/prism-lite/prism.js";
script.onload = () => {
setTimeout(() => {
this.redrawSyntaxHighlighting();
this.updateLineNumbers();
}, 0);
// if (typeof Prism !== 'undefined') {
// console.log("Prism is loaded: ", Prism.languages);
// // Ensure Prism and its languages are loaded
// // if (Prism.languages.javascript && Prism.languages.sql) {
// console.log("Prism languages are loaded");
// // Define a new token for highlighting "user_profile"
// const schemaPattern = {
// 'db-schema': { // This is the token name
// pattern: /\buser_profile\b/, // Matches "user_profile" as a whole word
// // alias: 'special-class' // Use 'alias' to apply a special CSS class
// }
// };
// // Insert the new token in JavaScript and SQL languages before 'keyword', or another suitable token
// Prism.languages.insertBefore('javascript', 'keyword', schemaPattern);
// Prism.languages.insertBefore('sql', 'keyword', schemaPattern);
// // }
// Prism.highlightAllUnder(this.shadow);
// }
};
this.shadow.appendChild(script);
The text was updated successfully, but these errors were encountered:
Removing this from the code since it was commented out and unused at the moment, but would be great to add back in shortly. Whenever we want to add custom syntax token styles we can use regex to identify and add it to the Prism rules. Placing code here for reference.
The text was updated successfully, but these errors were encountered: