Forum Bugs

Problem with HTML 5 <menu>

vargenau
Hello,

My website is now in HTML 5, using the new HTML 5 tags like <header>, <footer> or <article>.

In my print CSS, I have
header { display: none; }
and this works perfectly (except a warning message: prince: http://xxxx:45: error: Tag header invalid)

However, this does not work with the HTML 5 <menu> tag.

I have:
<menu id="actionbuttons">

Using:
menu { display: none; }
or
#actionbuttons { display: none; }

the menu content gets printed.

Can this be fixed?

Best regards,

Marc-Etienne Vargenau
mikeday
I can't reproduce this issue with this sample document:
<!DOCTYPE html>
<html>
<head>
<style>
menu { display: none }
</style>
</head>
<body>
<menu>
This text will not be visible.
</menu>
</body>
</html>
vargenau
<!DOCTYPE html>
<html>
<head>
<title>Prince menu bug</title>
<style>
@media print {
    menu { display: none }
}
</style>
</head>
<body>
This text will be visible when printed.
<menu>
<ul>
<li>
This text will not be visible when printed.
</li>
</ul>
</menu>

</body>
</html>
mikeday
Thanks, I see it now. It's actually a HTML parser issue: the <menu> tag is being closed as soon as the <ul> tag is seen, so it does not actually include the following content. Our new HTML5 parser will fix this, but in the meantime I think the only option is to use the XML parser ("-i xml" on the command-line).
vargenau
mikeday wrote:
Thanks, I see it now. It's actually a HTML parser issue: the <menu> tag is being closed as soon as the <ul> tag is seen, so it does not actually include the following content. Our new HTML5 parser will fix this, but in the meantime I think the only option is to use the XML parser ("-i xml" on the command-line).


Hello Mike,

Thank you for the XML trick. It works great and avoids the warnings about HTML 5 tags.

Will the new parser be available in Prince 8.1?

Best regards,

Marc-Etienne Vargenau
mikeday
Hopefully yes, although it may not be enabled by default, we haven't yet decided.
mikeday
Prince 9 is now available, and enables HTML5 parsing by default, which should fix this issue.
vargenau
Hello Mike,

Issue is fixed.

Thank you.