Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page property can give rise to empty sections #145

Open
bertfrees opened this issue Mar 3, 2017 · 6 comments
Open

page property can give rise to empty sections #145

bertfrees opened this issue Mar 3, 2017 · 6 comments

Comments

@bertfrees
Copy link
Member

bertfrees commented Mar 3, 2017

Back in commit 8d1a23a I removed a step from css-to-obfl that deleted empty sections, and instead tried to make sure that no empty sections where created in the first place, by properly propagating page breaks before running css:split. This seemed like a much better approach because it follows the CSS model better, and also because the step that was responsible for deleting empty sections was doing something that I much rather wanted to leave up to the actual formatter (Dotify).

The downside of this change is that a page property can give rise to empty section in some cases, possibly because the propagating of page breaks is possibly not done correctly, but that is hard to say because the CSS specification isn't entirely clear on this. This is an example where the frontmatter will be in an empty section because the forced page break before bodymatter is not propagated:

<frontmatter>
   <!-- (empty) -->
</frontmatter>
<bodymatter style="page:body">
   ...
</bodymatter>

My reasoning was that this should be fixed by setting frontmatter to display: none so I left the behavior as it is. One thing that I didn't think of is that it is not always straightforward (but not impossible) to tell when frontmatter will be empty because the flow property can be used to move certain descendants out.

bertfrees added a commit to nlbdev/pipeline that referenced this issue Mar 3, 2017
@dkager
Copy link
Contributor

dkager commented Mar 3, 2017

My reasoning was that this should be fixed by setting frontmatter to display: none so I left the behavior as it is.

Do you mean that if you omit display:none, then there will be a blank page before the bodymatter? This sounds like the right behavior to me. In that case the empty page shows that there is a frontmatter, but it is empty. Suppressing that empty page is an 'optimization'.
On the other hand, if a document ends with a page-break-after:always, then that should maybe be removed. This is akin to how a margin-bottom followed by nothing probably shouldn't lead to another page containing just that margin.

@bertfrees
Copy link
Member Author

Do you mean that if you omit display:none, then there will be a blank page before the bodymatter?

A blank sheet, yes.

On the other hand, if a document ends with a page-break-after:always, then that should maybe be removed.

Yes. I know, that needs fixing too. It's a different issue though.

@dkager
Copy link
Contributor

dkager commented Mar 3, 2017

Yes, just trying to get the requirements/terminology clear. :)

@bertfrees
Copy link
Member Author

K, thnx ;)

josteinaj pushed a commit to nlbdev/pipeline that referenced this issue Mar 8, 2017
bertfrees added a commit to nlbdev/pipeline that referenced this issue Jun 27, 2017
@bertfrees
Copy link
Member Author

Note that since commit 16a4e34, empty sections can not be caused by page-break-before: right anymore, but they can still be cause by apage property.

@bertfrees bertfrees changed the title page property can give rise to empty sections page property can give rise to empty sections Mar 21, 2020
@bertfrees
Copy link
Member Author

Needs test to check whether this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants