Skip to content

Commit

Permalink
Fix markdown export (#2)
Browse files Browse the repository at this point in the history
* Feat enable rendering of <img> tags in markdown

* Feat add chromium dependencies to Dockerfile
  • Loading branch information
minai621 authored Jul 23, 2024
1 parent c97340f commit fc0add6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 13 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,17 @@ COPY --from=builder /app ./
RUN apk upgrade --update-cache --available && \
apk add openssl && \
rm -rf /var/cache/apk/*

RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser

EXPOSE 3000
CMD ["npm", "run", "start:prod"]
CMD ["npm", "run", "start:prod"]
7 changes: 6 additions & 1 deletion backend/src/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ import { ExportFileRequestBody, ExportFileResponse } from "./types/export-file.t
@Injectable()
export class FilesService {
private s3Client: S3Client;
private readonly markdown = new MarkdownIt();
private readonly markdown: MarkdownIt;

constructor(
private configService: ConfigService,
private prismaService: PrismaService
) {
this.s3Client = new S3Client();
this.markdown = new MarkdownIt({
html: true,
breaks: true,
linkify: true,
});
}

async createUploadPresignedUrl(
Expand Down

0 comments on commit fc0add6

Please sign in to comment.