Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions front-end/components/bloom.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const createBloom = (template, bloom) => {
bloomTimeLink.setAttribute("href", `/bloom/${bloom.id}`);
bloomContent.replaceChildren(
...bloomParser.parseFromString(_formatHashtags(bloom.content), "text/html")
.body.childNodes
.body.childNodes,
);

return bloomFrag;
Expand All @@ -37,8 +37,8 @@ const createBloom = (template, bloom) => {
function _formatHashtags(text) {
if (!text) return text;
return text.replace(
/\B#[^#]+/g,
(match) => `<a href="/hashtag/${match.slice(1)}">${match}</a>`
/\B#\w+/g,
(match) => `<a href="#/hashtag/${match.slice(1)}">${match}</a>`,
);
}

Expand Down Expand Up @@ -84,4 +84,4 @@ function _formatTimestamp(timestamp) {
}
}

export {createBloom};
export { createBloom };
20 changes: 8 additions & 12 deletions front-end/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Purple Forest</title>
<link href="/index.css" rel="stylesheet" />
<link href="./index.css" rel="stylesheet" />
</head>
<body id="app">
<header>
<a href="/"
><h1>
<img
src="/logo.svg"
alt="Purple Forest "
width="50"
height="60"
/>
<img src="./logo.svg" alt="Purple Forest " width="50" height="60" />
PurpleForest
</h1></a
>
Expand Down Expand Up @@ -189,8 +184,7 @@ <h1 id="signup-heading" class="signup__title">Create your account</h1>
</div>
<div class="profile__who-to-follow">
<h4>Who to follow</h4>
<ul data-who-to-follow>
</ul>
<ul data-who-to-follow></ul>
</div>
</section>
</template>
Expand Down Expand Up @@ -236,7 +230,9 @@ <h2 id="bloom-form-title" class="bloom-form__title">Share a Bloom</h2>
<article class="bloom box" data-bloom data-bloom-id="">
<div class="bloom__header flex">
<a href="#" class="bloom__username" data-username>Username</a>
<a href="#" class="bloom__time"><time class="bloom__time" data-time>2m</time></a>
<a href="#" class="bloom__time"
><time class="bloom__time" data-time>2m</time></a
>
</div>
<div class="bloom__content" data-content></div>
</article>
Expand All @@ -256,6 +252,6 @@ <h2 id="bloom-form-title" class="bloom-form__title">Share a Bloom</h2>
<p>Please enable JavaScript in your browser.</p>
</noscript>

<script type="module" src="/index.mjs"></script>
<script type="module" src="./index.mjs"></script>
</body>
</html>