fix: Interpret relative URLs correctly. #19

Merged
glen merged 1 commits from base_url into main 2023-09-11 03:44:17 +00:00
3 changed files with 9 additions and 8 deletions
Showing only changes of commit 4c596392bc - Show all commits

View File

@ -33,7 +33,7 @@
url: 'https://code.studioinfinity.org/glen/archematics.git',
},
devDependencies: {
'@danielx/civet': '^0.6.31',
'@danielx/civet': '^0.6.36',
'@types/jquery': '^3.5.18',
'http-server': '^14.1.1',
typescript: '^5.2.2',

View File

@ -11,8 +11,8 @@ dependencies:
devDependencies:
'@danielx/civet':
specifier: ^0.6.31
version: 0.6.31(typescript@5.2.2)
specifier: ^0.6.36
version: 0.6.36(typescript@5.2.2)
'@types/jquery':
specifier: ^3.5.18
version: 3.5.18
@ -32,8 +32,8 @@ packages:
'@jridgewell/trace-mapping': 0.3.9
dev: true
/@danielx/civet@0.6.31(typescript@5.2.2):
resolution: {integrity: sha512-nI+/CbAqlM4uKN3BGmOIJgCeEv8MsGs2sC7Vx9nUrqXFJi9KPMWUhGIDb+hp/PodjgzRw0iH2bbSzW17KeiyoA==}
/@danielx/civet@0.6.36(typescript@5.2.2):
resolution: {integrity: sha512-ApMaq2YyXfiM0xpcFWRZffVLgqxrYu3UWS5A0sWViK+RMeamVp6J0iGUeUsQFCF2Gd9+ldEPzWgUThzUcfQKnA==}
engines: {node: '>=19 || ^18.6.0 || ^16.17.0'}
hasBin: true
peerDependencies:

View File

@ -15,9 +15,10 @@ else if url.includes '.wrl'
// Need to obtain the text and check what level it is
response := await fetch url
text .= await response.text()
if /#\s*VRML\s*V?1./i.test(text)
text = convert(text)
if /#\s*VRML\s*V?1[.]/i.test text
text = convert text
browser.baseURL = url
scene := await browser.createX3DFromString text
browser.replaceWorld(scene)
browser.replaceWorld scene
site.after(canvas)