nlbdev / nordic-epub3-dtbook-migrator

Tools for converting between a strict subset of DTBook and EPUB3.
http://nlbdev.github.io/nordic-epub3-dtbook-migrator/
GNU Lesser General Public License v2.1
8 stars 7 forks source link

hr separator not allowed between code blocks and in poems #521

Closed martinpub closed 1 year ago

martinpub commented 1 year ago

<pre> is a block-level element, but the following is not allowed according to the validator:

<pre><code>if (uttryck)
 sats;
else {
 en eller flera satser
}</code></pre>
<hr class="separator"/>
<pre><code>if (uttryck) {
 en eller flera satser
}
else
 sats;</code></pre>

The message from the validator is: "element 'pre' not allowed yet; missing required element 'p'". I think it is good not to overuse this separator, perhaps the separator in the example and should be solved with CSS to mark the boundaries of the pre/code sections? Perhaps my example is not the intended use of the hr sep. Let me know what you think.

josteinaj commented 1 year ago

My first thought is that hr would not be appropriate in this case, but I don't really have a strong opinion. In any case, it should be technically valid, so this is indeed a bug.

martinpub commented 1 year ago

And I would agree with you @josteinaj :-) I guess the interpretation depends on how much we want our productions to preserve separation marks from the print editions. I think the main case is in text to indicate a thematic break. In my example, we had several code examples and the "thematic break" semantics is much weaker there, since we have rather a list of examples. But I think I agree, it should be technically valid. It could be an accompanying task for guidelines development to clarify more about the use.

oscarlcarlsson commented 1 year ago

I have seen this happen in poems as well.

josteinaj commented 1 year ago

@martinpub @kalaspuffar solved?

kalaspuffar commented 1 year ago

To my knowledge, yes.