Inconsistent Parson format between HTML and manifest

1 view
Skip to first unread message

Andrew Scholer

unread,
Nov 1, 2025, 2:00:15 PMNov 1
to prete...@googlegroups.com
Rob/Sean...

It looks like the root of the recent issue Sean discovered (https://groups.google.com/g/pretext-support/c/yTIZZ68KMoY) is that the rendering of newlines in Parsons blocks differs between HTML output and the manifest.

Here is the exercise Sean identified the problem in:
https://github.com/sean-fitzpatrick/APEXCalculusPTX/blob/f21d5dcf98a6ff0868519f25f8633ecfe7fa7291/ptx/sec_optimization.ptx#L585

This block:

      <block order="2">
        <p>
          The <em>fundamental equation</em> is  <m>S= 2\pi r^2 + 2\pi r h</m>
        </p>
        </block>

Renders as this in the HTML:

<div class="para" id="APEX-PROTEUS-optimization-2-v1-3-2-1">The <em class="emphasis">fundamental equation</em> is  <span class="process-math">\(S= 2\pi r^2 + 2\pi r h\)</span>
</div>
---

It renders as this in the manifest:

                <pre class="parsonsblocks" data-question_label="" style="visibility: hidden;" data-language="natural" data-adaptive="true" data-noindent="true"><div class="para" id="APEX-PROTEUS-optimization-2-v1-3-1-1">The quantity to minimize is the total surface area of the cylinder.</div>
---

Notice where the final </div> is placed.

Various templates insert newlines in the output. It looks like when XSL produces output with method="xml", those newlines are treated differently than when using method="html".

The HTML output uses method="html", but the runestone-manifest file uses "xml".


Rob - that is the issue, but I don't know how it would best be solved. Something like this did come up before in:
https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzNC5iZWV6ZXI.1695911201%40quikprotect


Andrew

Sean Fitzpatrick

unread,
Nov 1, 2025, 4:37:23 PMNov 1
to PreTeXt development
Andrew, I notice that your block example in HTML is not the same block as the example from the manifest. 

I'm not sure if that matters but I thought I should point it out.

--
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 visit https://groups.google.com/d/msgid/pretext-dev/CACm44N-OBcvSW_U7CkG7V5-kNF1fWcGDtXVVbjLnztLDsgZ14w%40mail.gmail.com.

Andrew Scholer

unread,
Nov 1, 2025, 5:36:51 PMNov 1
to prete...@googlegroups.com
Sorry, yes, copied wrong block. But the important bit is where the </div> appears.

In the HTML it is on a new line.

In the manifest, it is on the same line.

Thus in the book, where the problem is loaded from the HTML in the page, there are more "lines" in each block than when the same block is loaded from the DB (which came from manifest) on an assignment page.

User answers are stored in an abstracted format that for each block lists the line numbers it has. When you have an answer produced in one location, it makes no sense in the other location.


Reply all
Reply to author
Forward
0 new messages