Closed karlhorky closed 3 years ago
Ah wait, it seems like I didn't load the js-templates
language, that's necessary too:
refractor/lang/sql.js
)refractor/lang/js-templates.js
)Updated the demo above, now it's working!
"children": [
{
"type": "text",
"value": "\n "
},
{
"type": "element",
"tagName": "span",
"properties": {
"className": [
"token",
"keyword"
]
},
"children": [
{
"type": "text",
"value": "SELECT"
}
]
},
{
"type": "text",
"value": " "
},
{
"type": "element",
"tagName": "span",
"properties": {
"className": [
"token",
"operator"
]
},
"children": [
{
"type": "text",
"value": "*"
}
]
},
{
"type": "text",
"value": " "
},
{
"type": "element",
"tagName": "span",
"properties": {
"className": [
"token",
"keyword"
]
},
"children": [
{
"type": "text",
"value": "FROM"
}
]
},
{
"type": "text",
"value": " users "
},
{
"type": "element",
"tagName": "span",
"properties": {
"className": [
"token",
"keyword"
]
},
"children": [
{
"type": "text",
"value": "WHERE"
}
]
},
{
"type": "text",
"value": " id "
},
{
"type": "element",
"tagName": "span",
"properties": {
"className": [
"token",
"operator"
]
},
"children": [
{
"type": "text",
"value": "="
}
]
Sorry for the noise!
Since
prism@1.24.0
, there has been the possibility of highlighting the SQL within tagged template literals: https://github.com/PrismJS/prism/pull/2945#issuecomment-873616841refractor
updated to that version in e642cae669cd430d59452ddd44c8bbdc21482704But it appears that this is not working, unless I have done something wrong here:
https://replit.com/@karlhorky/refractor-demo