Skip to content

Commit 2353300

Browse files
committed
Updated HTML export
1 parent e5b8066 commit 2353300

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/export/writeHtml.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export function writeHtml({
9090
const topHTML = Math.round((activeLine.y1 - activeLine.maxFontBoundingBoxAscentLine) * 1000) / 1000;
9191
bodyStr += ` <div class="scribe-line" style="left:${activeLine.left}px;top:${topHTML}px;">\n`;
9292
bodyStr += activeLine.bodyWordsStr;
93+
bodyStr += ' <br>\n';
9394
bodyStr += ' </div>\n';
9495
}
9596
activeLine.bodyWordsStr = '';
@@ -128,7 +129,7 @@ export function writeHtml({
128129

129130
const imageObj = images ? images[g] : null;
130131
if (imageObj) {
131-
bodyStr += ` <img src="${imageObj.src}">\n`;
132+
bodyStr += ` <img class="scribe-image" src="${imageObj.src}">\n`;
132133
}
133134

134135
if (removeMargins) {
@@ -339,6 +340,12 @@ export function writeHtml({
339340
styleStr += ' white-space:nowrap;\n';
340341
styleStr += ' }\n';
341342

343+
styleStr += ' .scribe-image {\n';
344+
styleStr += ' position:absolute;\n';
345+
styleStr += ' user-select:none;\n';
346+
styleStr += ' pointer-events:none;\n';
347+
styleStr += ' }\n';
348+
342349
for (const fontI of fontsUsed) {
343350
const cdnPath = 'https://cdn.jsdelivr.net/npm/[email protected]/fonts/all/';
344351
let styleTitleCase = fontI.style.charAt(0).toUpperCase() + fontI.style.slice(1).toLowerCase();

0 commit comments

Comments
 (0)