Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
archibald-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
William Faircloth
archibald-ui
Commits
16e75dc0
Commit
16e75dc0
authored
4 months ago
by
William Faircloth
Browse files
Options
Downloads
Patches
Plain Diff
add imgs
parent
8e59184b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#6041
failed
4 months ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/routes/+page.svelte
+16
-1
16 additions, 1 deletion
src/routes/+page.svelte
with
16 additions
and
1 deletion
src/routes/+page.svelte
+
16
−
1
View file @
16e75dc0
...
...
@@ -20,6 +20,21 @@
behavior
:
'
instant
'
});
});
function
fixImgs
(
html
:
string
):
string
{
const
parser
=
new
DOMParser
();
const
doc
=
parser
.
parseFromString
(
html
,
'
text/html
'
);
const
imgs
=
doc
.
querySelectorAll
(
'
img
'
);
imgs
.
forEach
(
img
=>
{
const
src
=
img
.
getAttribute
(
'
src
'
);
if
(
src
&&
!
src
.
startsWith
(
'
http
'
))
{
img
.
setAttribute
(
'
src
'
,
new
URL
(
src
,
"
https://systems.cs.odu.edu/img/
"
).
href
);
}
});
// delete all "{width=".*"}"
return
doc
.
body
.
innerHTML
.
replaceAll
(
/{width=".*"}/g
,
''
);
}
</script>
<div
...
...
@@ -42,7 +57,7 @@
</div>
<div
class=
"answer"
>
<h3>
Archibald
</h3>
<div
class=
"bubble"
>
{
@html
converter
.
makeHtml
(
context
.
response
)
}
</div>
<div
class=
"bubble"
>
{
@html
fixImgs
(
converter
.
makeHtml
(
context
.
response
)
)
}
</div>
</div>
{
/each
}
{
/if
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment