diff --git a/resources/js/components/SMHTML.vue b/resources/js/components/SMHTML.vue
index 1cda9d5..2dd85d1 100644
--- a/resources/js/components/SMHTML.vue
+++ b/resources/js/components/SMHTML.vue
@@ -21,14 +21,30 @@ const props = defineProps({
const computedContent = computed(() => {
let html = "";
- const regex = new RegExp(
+ // Convert local links to router-links
+ const regexHref = new RegExp(
`]*?)href="${
(import.meta as ImportMetaExtras).env.APP_URL
}(.*?>.*?)`,
"ig"
);
+ html = props.html.replace(regexHref, '');
- html = props.html.replace(regex, '');
+ // Update local images to use at most the large size
+ const regexImg = new RegExp(
+ `
]*?)src="${
+ (import.meta as ImportMetaExtras).env.APP_URL
+ }/uploads/([^"]*?)"`,
+ "ig"
+ );
+ html = html.replace(
+ regexImg,
+ `
{
watch(
() => imageUrl.value,
(value) => {
- styleObject["backgroundImage"] = `url('${value}')`;
+ const url = imageMedium(value);
+ styleObject["backgroundImage"] = `url('${url}')`;
}
);