canvas-editor icon indicating copy to clipboard operation
canvas-editor copied to clipboard

分节符

Open ssdutnowind opened this issue 1 year ago • 4 comments

What problem does this feature solve?

建议引入“节”的定义,目前概念上缺少一层“节”,类似Word不同节可以进行不同的页面设置(类似一些不分页面横向排版、不分页面单独的页眉、页脚格式等)。

What does the proposed API look like?

None

ssdutnowind avatar Nov 04 '24 01:11 ssdutnowind

@ssdutnowind like a "Paragraph" block?

I noticed the API treats "text" as the leaf node and if you have a "text" element with a valueList the runs / blocks in the valueList are not rendered.

Keeping the "text" function the same, a "Paragraph" block (automatically created after two enters key presses) would be great and it is more similar to the Google Docs / MS Word API.

jordanparker6 avatar Nov 04 '24 06:11 jordanparker6

In MS Word Document Model, a Word Document contains some Sections. The Page Setup is belong to Section not to Document. Every Section has its own "PageSetup", you can define different page setups in one Word Document. For example some section's page size is A4 and some are A5, or some section has page header and some section do not have, or even has different orientations.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.sections?view=word-pia

ssdutnowind avatar Nov 04 '24 08:11 ssdutnowind

I'm currently trying to make a DOCX import feature that does not require an HTML conversion before.

So I think that the library should have the notion of paragraph if we want the editor to be able to work more like MS Word.

Sections would be good too

PhenX avatar Jan 19 '25 15:01 PhenX

@PhenX any luck on this? I am happy to help contribute. I need to work on this functionality as well.

jordanparker6 avatar Aug 06 '25 10:08 jordanparker6