Skip to content

Commit

Permalink
fix: link hyphenation
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Aug 6, 2024
1 parent 6400741 commit bb2af91
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/pdf/src/report.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Document, PDFViewer, Page } from "@react-pdf/renderer";
import { Document, Font, Page } from "@react-pdf/renderer";
import { Html } from "react-pdf-html";
import React from "react";
import type { Udap, Report, Service_instructeurs, Clause_v2 } from "@cr-vif/electric-client/frontend";

Font.registerHyphenationCallback((word) => {
console.log(word);
return [word];
});

export const ReportPDFDocument = ({ udap, htmlString, images }: ReportPDFDocumentProps) => {
return (
<Document>
Expand Down Expand Up @@ -93,7 +98,6 @@ export const ReportPDFDocument = ({ udap, htmlString, images }: ReportPDFDocumen
align-items: flex-end;
}
</style>
<div class="header">
<div class="marianne">
Expand Down Expand Up @@ -187,6 +191,8 @@ export const getReportHtmlString = (
Ref cadastrale : ${report.projectCadastralRef ?? ""}<br/>
</p>
<span class="link">https://stackoverflow.com/questions/8753296/how-to-prevent-line-break-at-hyphens-in-all-browsers</span>
<p>
<strong>Objet de la demande : ${report.title ?? ""}</strong>
</p>
Expand Down

0 comments on commit bb2af91

Please sign in to comment.