List numbering of <solution><ol><li><me> in Chrome vs Firefox

39 views
Skip to first unread message

Steven Clontz

unread,
Nov 1, 2021, 5:57:50 PM11/1/21
to PreTeXt development
Full conversation here for context that led to this post: https://github.com/StevenClontz/checkit/issues/56

What's relevant for PreTeXt: It seems that, at least inside of a <solution/>, <ol><li><me>x^2</me></li></ol> is numbered in Chrome, but not in Firefox. Numbering happens as expected in both browsers outside of a <solution/>, as well as if a <p/> is used to contain the <me/>.



Chrome screenshot [Windows Version 95.0.4638.54 (Official Build) (64-bit)]: Screenshot 2021-11-01 165204.png

Firefox screenshot [Windows 93.0 (64-bit)]: Screenshot 2021-11-01 165338.png

Rob Beezer

unread,
Nov 1, 2021, 6:22:53 PM11/1/21
to prete...@googlegroups.com
The list item is not authored with a "p" (which is fine), so we wrap it in an
HTML "p" as it becomes output. But the list item consists of display math
(only), which is rendered inside a "div". So we get a "div" inside a "p", which
is a no-no. Not sure if this is the cause, but it is bad, no matter what.

Busting up a PreTeXt "p" containing display math (and/or nested lists) is a very
delicate business. Maybe the pre-processing step should be supplying the "p"
that we absolved the author from providing?

Rob

On 11/1/21 2:57 PM, Steven Clontz wrote:
> Full conversation here for context that led to this
> post: https://github.com/StevenClontz/checkit/issues/56
>
> What's relevant for PreTeXt: It seems that, at least inside of a <solution/>,
> <ol><li><me>x^2</me></li></ol> is numbered in Chrome, but not in Firefox.
> Numbering happens as expected in both browsers outside of a <solution/>, as well
> as if a <p/> is used to contain the <me/>.
>
> Here's a MWE: https://stevenclontz.github.io/potential-journey/ch-empty.html
>
> Source: https://github.com/StevenClontz/potential-journey/blob/main/source/ch_empty.ptx
>
> Chrome screenshot [Windows Version 95.0.4638.54 (Official Build) (64-bit)]:
> Screenshot 2021-11-01 165204.png
>
> Firefox screenshot [Windows 93.0 (64-bit)]: Screenshot 2021-11-01 165338.png
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com
> <mailto:pretext-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/04d40553-0c8d-468a-9a93-97ce06ffc4ben%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-dev/04d40553-0c8d-468a-9a93-97ce06ffc4ben%40googlegroups.com?utm_medium=email&utm_source=footer>.

Steven Clontz

unread,
Nov 1, 2021, 7:38:37 PM11/1/21
to prete...@googlegroups.com
Question I've put off asking but have been afraid to ask: what exactly is preprocessing in the context of Pretext? I'd assume it means conversion of more lenient Pretext into a canonical form so writing XSL is easier, but I'm not sure where that's implemented (if anywhere).

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/Jq8OZ8tFpsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/cbc67405-6bc4-2a15-abfe-0fd33df99ffb%40ups.edu.

David Farmer

unread,
Nov 1, 2021, 8:22:14 PM11/1/21
to prete...@googlegroups.com

> HTML "p" as it becomes output. But the list item consists of display math
> (only), which is rendered inside a "div". So we get a "div" inside a "p",
> which is a no-no. Not sure if this is the cause, but it is bad, no matter
> what.

That is the cause. More specifically, when the browser sees
< p >
< div >

It converts it to
< p ></ p >
< div >

That empty p is the problem, in Firefox anyway.

So, when a p only contains display math, don't make the p.

More generally, when a p starts with display math (see only comments of
mine for what that should never happen), don't put a p before the math.
> email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/cbc67405-6bc4-2a15-abfe-0fd33df99ffb%40ups.edu.
>

Alex Jordan

unread,
Nov 1, 2021, 8:39:57 PM11/1/21
to prete...@googlegroups.com
I'll repeat a suggestion I made in the past. That container does not
need to be a div. It could a p. Specifically, a p.displaymath.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/alpine.LRH.2.21.2111012009260.13427%40li375-150.members.linode.com.

David Farmer

unread,
Nov 1, 2021, 8:55:35 PM11/1/21
to prete...@googlegroups.com

I don't think that makes it easier, because you still need to break up
PTX p's and also not wrap a p around the .displaymath .
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/CA%2BR-jreTW0N%2B3Cv-Uex2GK56MqLuH6VHD4ifkX%3D8Tj6WweHF0w%40mail.gmail.com.
>

Rob Beezer

unread,
Nov 1, 2021, 10:53:38 PM11/1/21
to prete...@googlegroups.com
On 11/1/21 4:38 PM, Steven Clontz wrote:
> I'd assume it means conversion of more
> lenient Pretext into a canonical form so writing XSL is easier,

That's an evolving use (and phrased quite nicely). Originally it was
"assembling" bits and pieces from elsewhere. Now it also "repairs" deprecated
elements/constructions.

> but I'm not sure
> where that's implemented (if anywhere).

https://github.com/rbeezer/mathbook/blob/dev/xsl/pretext-assembly.xsl

But be aware that I'm in the midst of reorganizing it ("refactoring" would be an
exaggeration).

Rob

Alex Jordan

unread,
Nov 2, 2021, 12:10:09 AM11/2/21
to prete...@googlegroups.com
Here is another idea from the past. There was an objection to this
that I don't recall. The current PTX p that break up into multiple
HTML p (because of ol, ul, dl, display math, and display code) becomes
a single div.p. There are no HTML p inside this div.p.

This example becomes something like:
<li>
<div.p>
<div.displaymath>
text nodes with the math

(div inside li is legal; I checked)


PTX source with more to it like:
<p>
A list:
<ol>...</ol>
and some math:
<me>...</me>
<p>

becomes:
<div.p id="p-42">
A list:
<ol>...</ol>
and some math:
<div.displaymath>....</div>
</div>
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/eb55196d-8dd8-9117-da33-874f384efec8%40ups.edu.
Reply all
Reply to author
Forward
0 new messages