feat: support markdown in chat and resource #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several updates and enhancements to the project, focusing on markdown rendering. The most important changes include adding new dependencies, implementing markdown rendering, and updating the Tailwind CSS configuration.
resolve #53
Dependency Additions:
package.json
: Addeddompurify
andmarked
dependencies. [1] [2]pnpm-lock.yaml
: Addeddompurify
,marked
, and@types/trusted-types
packages. [1] [2] [3] [4] [5] [6] [7] [8]Markdown Rendering:
src/lib/components/Chatroom.svelte
: IntegratedrenderMarkdown
function to render markdown content in chat messages. [1] [2]src/lib/components/session/HostView.svelte
: UsedrenderMarkdown
function to render markdown content in session resources. [1] [2]src/routes/template/[id]/ResourceList.svelte
: AppliedrenderMarkdown
function to render markdown content in resource lists. (src/routes/template/[id]/ResourceList.svelteR8, src/routes/template/[id]/ResourceList.svelteL218-R227)src/lib/utils/renderMarkdown.ts
: CreatedrenderMarkdown
function to convert markdown to sanitized HTML usingmarked
andDOMPurify
.Configuration Improvements:
tailwind.config.ts
: Updated Tailwind CSS configuration to include custom typography styles under thehina
key.Miscellaneous Changes:
src/lib/stores/auth.ts
: UpdatedsignOut
function to accept a fetch function parameter for better testability.src/routes/login/+page.server.ts
: Passed the fetch function to thesignOut
function.