Preserve QWord page breaks in DOCX
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
PaintBucket,
|
||||
Pilcrow,
|
||||
Save,
|
||||
SeparatorHorizontal,
|
||||
Strikethrough,
|
||||
Type,
|
||||
Underline
|
||||
@@ -144,6 +145,10 @@ export function QWord({ document, onChange }: QWordProps) {
|
||||
updateHtml();
|
||||
}
|
||||
|
||||
function insertPageBreak() {
|
||||
runCommand("insertHTML", '<span data-qoffice-page-break="true" contenteditable="false"></span><p><br></p>');
|
||||
}
|
||||
|
||||
async function insertImage(file: File | undefined) {
|
||||
if (!file) {
|
||||
return;
|
||||
@@ -278,6 +283,9 @@ export function QWord({ document, onChange }: QWordProps) {
|
||||
<button type="button" onClick={insertLink} title="Вставить ссылку">
|
||||
<Link size={16} />
|
||||
</button>
|
||||
<button type="button" onClick={insertPageBreak} title="Разрыв страницы" aria-label="Разрыв страницы">
|
||||
<SeparatorHorizontal size={16} />
|
||||
</button>
|
||||
<button type="button" onClick={() => imageInputRef.current?.click()} title="Вставить изображение">
|
||||
<ImageIcon size={16} />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user